SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem Reading Data From File

    This should be easy, but I can't seem to figure it out... I'm loading mixed data into a Record, so I have to use FileReadValue. This works fine as long as I have a different file for each set of data. But what I want to do is load all of the data for various testcases into the same file.

    How do I read the first line ONLY so I can then process it? How do I then read the 2nd line ONLY, and so forth? Is it possible to close the file after reading one line, then open it and read the next line?

    I suppose I could read the entire file into a 'List of Records', but I'd prefer the one-at-a-time approach. Any help will be greatly appreciated...

    Thanks,
    ~ Fred

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

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Reading Data From File

    while(FileReadLine (hFile, sLine))

    sLine is the line read. It goest from line 1 to end of file.



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

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Brookline,NH USA
    Posts
    147
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem Reading Data From File

    Well, that is actually not what I'm looking for (and it's the wrong function to boot) -- this is nothing more than what is in the online help...

    I do, however, think I found my solution:

    void FileReadValueSpecific (myUserDefinedType myUDT, integer iLine)
    ....For iCounter = 1 to iLine
    ........FileReadValue (hFile, myUDT)

    This reads each line up until and including the line I want, then stops. It may do more reads than I need, but I can choose the line I want to retrieve this way and ignore the rest, which was my original goal...


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


    [This message has been edited by RagerXS (edited 02-07-2002).]

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:56 AM.

Copyright BetaSoft Inc.