Results 1 to 5 of 5

Thread: EOF marker

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    67

    Talking

    How does one insert an EOF marker in a text file?
    My VB program creates a text file that a third party app reads. Unless I open it up in notepad and save it, the third party app gives incorrect results. Could it be the EOF marker?

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    //

    as I'm told EOF markers are NOT really used
    touched on it briefly years ago
    add a record with a unique existance
    ie>
    Record = XXENDXX

    then use an if statement in your code
    if record = XXENDXX then do whatever

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    you could try this

    'count files in a directory

    public iFiles As Integer
    Dim sDir As String
    'set your own specs for file pattern
    sDir = Dir("C:\*.*", vbNormal + vbHidden + vbArchive + vbReadOnly + vbSystem)
    While sDir <> ""
    iFiles = iFiles + 1
    sDir = Dir
    Wend

    'when you use the file use a loop
    do while myVar <> iFiles
    'bla bla
    loop

    when you reach the count you stop processing
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    EOF "End Of File" IS what returns if a opened filenumber location (loc) is higher that (lof) length of file. That happens usually when you use input# and past the end of file and get that error.

    You cannot put a EOF marker, it's a VB function.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    The End of a text file is represented by ascii character #26. Just check the QBasic help file. If you have a do until EOF and the loop comes across this character it sees it as the end of the file and stops.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width