Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Urgent Help on LOC function in script

0 views
Skip to first unread message

Anthony SERFATI

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
it seems that the script finction Loc doesn't work correctly. This function
returns the cursor position in a file. My problem is that it alwas return 0
althougth it shouldn't. Someone has an idea avout that ?

There is z test script below. Thanks for the help


Sub Click(Source As Button)
Dim num As Integer
Dim car As String

num% = Freefile

Open "c:\fic.txt" For Input As num
Seek num% , 4
While Not( Eof(num%) )
car = Input(num% , 1)
Print Loc(num%)
Wend

Seek num% , 1
car = Input(num% , 1)
Print Loc(num%)
car = Input(numů , 1)
Print Loc(numů)
Close #num%

End Sub
--
ser...@lirmacmail.insa.rouen.fr

kle...@acm.org

unread,
Aug 3, 1999, 3:00:00 AM8/3/99
to
You have to open the file as binary. Opening it for Input as you have
done is opening it as a sequential file and the LOC function works
differently. Change "input" to "binary" in your open statement and it
should work.
Good luck,
Regards,
Don
kle...@acm.org
0 new messages