WriteChr() - problem with writing chrs to a file
Posted: Fri Jul 12, 2013 1:13 am
I have a little prob with writing chrs to a file. Probably I don't see the forrest for the trees, but I am really stuck here. I think the following snipped down mini program should write ABCD... to a file, but it doesn't it writes CEG... instead while the counter "my_frame" gets increased by 1 only everytime the routine is called.
Code: Select all
cfilename$= "Ram:blabla"
OpenFile (1,cfilename$, #MODE_WRITE)
toggle_rec=true
my_frame=0
Function p_rec_data()
If toggle_rec=True
my_frame=my_frame+1
DebugPrint (my_frame)
t=GetFileAttributes (cfilename$)
seek_pos=t.size
Seek (1, seek_pos)
WriteChr(1, 65+my_frame)
EndIf
EndFunction
Function p_main()
p_rec_data()
EndFunction
SetInterval(0, p_main, 125); 8Hz
Repeat
WaitEvent
Forever