AndyK
May 23rd, 2001, 10:46 PM
Here's an example of a code I have:
hfile = freefile
Open FileName for input as #hfile
do until eof(hfile)
input #hfile, iStr
if instr(.........) <> 0 then some other code
loop
close
Here's the question, when I find an Instr position of the character, How can I find that character's position in whole file. I could use a counter and count len(istr) for each line input, but is there any other way to get character position in the whole file. Second question is how to invert the procedure....say i know the position of the character in the file, ex. 3345, how can i get the line number where that character is located? I remember there was a CharToLinePos constant or something like that with some API (SendMessage API???) to do that, but i totally don't remember. If anyone can refresh my memory, i would greatly appreciate it. Thank You.
hfile = freefile
Open FileName for input as #hfile
do until eof(hfile)
input #hfile, iStr
if instr(.........) <> 0 then some other code
loop
close
Here's the question, when I find an Instr position of the character, How can I find that character's position in whole file. I could use a counter and count len(istr) for each line input, but is there any other way to get character position in the whole file. Second question is how to invert the procedure....say i know the position of the character in the file, ex. 3345, how can i get the line number where that character is located? I remember there was a CharToLinePos constant or something like that with some API (SendMessage API???) to do that, but i totally don't remember. If anyone can refresh my memory, i would greatly appreciate it. Thank You.