Announcement

Collapse
No announcement yet.

Load File

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

  • Load File

    How can I load a whole .txt file into one string?

  • #2
    Martin,
    something like this:
    Code:
    FileHandle&=FREEFILE
    OPEN "MyFile.txt" FOR BINARY AS fileHandle&
    GET$ FileHandle&,LOF(FileHandle&),MyString$
    CLOSE fileHandle&  
    
    'MyString$ now contains the file.
    Paul.

    Comment


    • #3
      Check the limitations of your operating system for haw large a string can be (2 gig is the norm i think?). If your file is bigger than that; think again.

      Also consider how much memory is in the average users system. (Specific to your users). If you keep hitting the paging file your performance will drop and you may benefit from doing things another way.

      Comment


      • #4
        Maybe not a limitation of a string (or maybe a limitation).
        Any file on a NON-NTFS format from my learning must be less than 2gig. (No I have no document as to why, but transferring a 12 gig file to a Win32 format USB drive, and the comment of Win32 only knows up to 2gig I would think my text vs any binary comment would hold true)
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

        Comment

        Working...
        X