[Gambas-user] Open File for Watch Read Past EOF
Jeff Zacher
ad_sicks at ...43...
Mon Jan 9 14:35:46 CET 2017
I am using Gambas 3.9.1
If I open a file for watch:
hFile = Open "test" For Read Write Watch
The _Read() event gets the first byte written to the file just fine. But
after, no changes to the file fire the read event. So as a workaround,
just close the file and reopen? On second read the _Read() event in
fired immediately and continues to fire past the eof until the file is
again closed.
Code to reproduce. Form with two buttons:
Gambas class file
Private hFile As File
Public Sub File_Read()
Dim iByte As Byte
If Not Eof(hfile) Then
Read #hFile, iByte
Print "Got one byte: "; iByte
Else
Print Time()
End If
End
Public Sub Button1_Click()
Close hFile
End
Public Sub Button2_Click()
hFile = Open "test" For Read Watch
End
More information about the User
mailing list