Results 1 to 8 of 8

Thread: Line Input - Help!!!

  1. #1

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116
    I want to do a Line Input after I found a certain word. So, if I found the word through a text file, I want to do the Line Input in the next line.

    Any suggestion???
    License to Program

    007

  2. #2
    Guest
    Code:
    Open "C:\Textfile.txt" For Input As #1
    Line Input #1, strLine$
    Text1.text = Text1.text & strLine$
    Close #1
    That what you want?

  3. #3

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116
    Thanks Matthrew but I already got that part.


    Example of my text file

    User1
    User2
    User3
    User4
    User5
    User6

    Beside using a loop going through each line, how can I get the line after I find User2. In this example, once I use instr to find "User2", it should return the next line which is "User3".
    License to Program

    007

  4. #4

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116
    Does anyone understand what I mean?

    I want to find a word using instr function and get the next line of data. Is it possible to do a Line Input in the middle of the text file?

    Thanks
    License to Program

    007

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    It is of course, if you only know where to start reading, use seek statement and function to locate next position to read.
    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.

  6. #6

    Thread Starter
    Lively Member James Bond 007's Avatar
    Join Date
    May 2000
    Location
    London
    Posts
    116

    Smile That worked! Thanks.

    What is the difference with these two?
    Loc(1) & Seek(1)


    What is the difference with these two?
    Filelen and LOF(1)



    [Edited by James Bond 007 on 10-31-2000 at 03:25 AM]
    License to Program

    007

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    no diff between loc and seek functions
    Filelen needs a filename and lof needs a open filenumber
    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.

  8. #8
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96

    Talking Another Difference

    Filelen is used when the file is not open.
    LOF only works if the file is open.

    H.


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