Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

any end of file command?

Status
Not open for further replies.

kmsam2

Programmer
May 21, 2003
29
0
0
MY
any "end of file" command to replace current for i = 1 to xxxx method? If I hardcode 100 then program will read first 100 line only:

for i = 1 to 100
fileRead(ll_FileNum, ls_Input) // read import text file
ls_input = trim(ls_input)
dw_1.insertrow(i)
dw_1.setitem (i, 'text1', ls_input)
next

Sam.
 
FileRead returns an integer.
It returns a -100 when it encounters an end of file before any characters are read.
So you could loop through the file until you get a value of -100. This would only work if the file is 32K or less in size (fileopen in line mode).

Matt

"Nature forges everything on the anvil of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top