Question about opening files...

J-Stew
09-08-2002, 08:16 PM
What exactly does this line of code do?

CODE:

data = Input$(LOF(1), 1)

END OF CODE

i am assuming that LOF means "length of file" but I wonder what the ...(1), 1) is for...

thedee
09-08-2002, 08:53 PM
the number 1 is the filenumber.. it could be a 2 or 3 or whatever number you opened the file up with.

J-Stew
09-08-2002, 09:07 PM
what about the second 1?

thedee
09-08-2002, 09:13 PM
data = Input$(LOF(1), 1)

Both the number 1's mean the file number you are working with.
What this statement will do is store the entire file into the data variable. The LOF(1) means to take the entire file, which is number 1 because that is what you opened it up with and store that in the variable.

You could have something like this:
data = Input$(1,1)
This statement will get only 1 character from the file
data = Input$(5,1)
This statement will get only 5 characters from file number 1 and so on...........

The very last number 1 is the file number. The first number is just saying how much data do I want to return.

Machaira
09-08-2002, 09:16 PM
[removed]

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum