I have spent some hours trying to solve this problem but I can not get it to work so I would be glad if someone could point me to what is wrong with the code (code output all right but do not input into string) :
Code: Select all
screenres 800,600
Dim As String buffer,filename
Dim As Integer f
filename = "FreeBASIC\MyFiles\FileTest.mine"
' OUTPUT
f = FreeFile
buffer = "1234567890"
Print "Opening output , FreeFile # ";f : Print
Open filename For Binary Access Write As #f
If Err>0 Then Print "Error opening the file":End
Put #f, , buffer
Close
Sleep
' INPUT
f = FreeFile
buffer = ""
Print "Opening input , FreeFile # ";f
Open filename For Binary Access Read As #f
If Err>0 Then Print "Error opening the file":End
Get #f, , buffer
Close
If buffer = "" then print : Print : print " FILE INPUT ERROR !!!!" : Print Else Print : print "Record = ";buffer
Sleep
Print : Print "File name is : ";filename : Print " Dir = " : Print CurDir : Print "Buffer = " ; buffer
Sleep