Announcement

Collapse
No announcement yet.

MAX string length in variable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    it has 8,584,877,294 characters ...This is a family history file..
    I don't think I want to know that much about <U>anyone's</U> family.

    Leave a comment:


  • Robert E. Carneal
    replied
    Originally posted by Michael Mattias:
    >If the file literally contains "billions" of characters, you will have to read them in chunks.
    I wrote a program to count the characters, and it has
    8,584,877,294 characters including punctuation marks and spaces.
    (thank goodness for P4s!)

    I will read them in chunks. I -had- thought about reading them in
    chunks, and write that to a temp file, and then use the temp file
    to create a properly formatted file. (This is a family history
    file, btw, and written before the advent of Windows, so it
    isn't properly formatted yet.)

    Thanks to everyone who responded!

    Robert



    ------------------

    Leave a comment:


  • Michael Mattias
    replied
    >That or pick up a copy of PB/CC..The console compiler should be able to digest that up to the available space on your hard drive.

    No, it can't. The maximum addressable user memory for a 32-bit application is 2.1 Gb only, not "available disk space. "

    If the file literally contains "billions" of characters, you will have to read them in chunks.

    Leave a comment:


  • Mel Bishop
    replied
    Originally posted by Ian Cairns:
    ...and input the file as managable chunks...
    That or pick up a copy of PB/CC . The console compiler should
    be able to digest that up to the available space on your hard
    drive. The syntax is quite similar but you would have to adjust
    your style to accomodiate it.


    ------------------

    Leave a comment:


  • Ian Cairns
    replied
    Robert,
    With PB3.2, the documentation says the maximum size of a string is 32750 bytes.
    I recommend that you open the file as binary, and input the file as managable chunks, ie:
    Code:
    fhandle% = freefile
    open "myfile.bin" for binary as # fhandle%
    do while not eof(fhandle%)
      GET$ #fhandle%, 32750, inputString$
    ' do something with input string
    wend

    happy new year,
    Ian Cairns

    ------------------
    [email protected]

    Leave a comment:


  • Paul Dixon
    replied
    Robert,
    I think the maximum possible string in PB/DOS is 32750 characters long.
    You'll have to limit your chunks to something less than that.

    Paul.

    Leave a comment:


  • Robert E. Carneal
    started a topic MAX string length in variable?

    MAX string length in variable?

    Thank you for the sample code to break a definition into smaller
    and easier manageable parts. Now, a variaion on this.

    I have several files that are just one line, but billions of
    characters long. I.e, there is no end-of-line or carriage return
    except at the very end. If I:

    Line Input #1, getall$

    How much of that single line will I confidently obtain? Should I
    purposely read in the first million characters, work with it,
    then read in the second million, work with it and repeat until
    done?

    Thank you.

    Robert

    ------------------
Working...
X