I think i found a buck while importing some Library-Functions:
Code: Select all
#SEEK_SET_=0
#SEEK_CUR_=1
#SEEK_END_=2
EnableExplicit
Import "libcpmt.lib"
fopen(fname$,fmode$)
fclose(c_stream.l)
fread(*buf,size.l,count.l,c_stream.l)
fwrite(*buf,size.l,count.l,c_stream.l)
fflush(c_stream.l)
fseek(c_stream.l,offset.l,origin.l)
ftell(c_stream.l)
feof(c_stream.l)
fgetc(c_stream.l)
fputs(str$,c_stream.l)
ungetc(char.l,c_stream.l)
EndImport
Procedure _FileSize(_stream)
Protected curpos.l, length.l;
Debug _stream
curpos = ftell(_stream);
Debug _stream ;-> streampointer is changed ?!?!?!?
fseek(_stream, 0, #SEEK_END_);
length = ftell(_stream);
fseek(_stream, curpos, #SEEK_SET_);
ProcedureReturn length;
EndProcedure
OpenConsole()
Global stream.l,le.l
stream = fopen("Scene1.bmp", "r+");
le.l = _FileSize(stream)
Print("FileLength : "+str(le))
Repeat : Until Inkey()
CloseConsole()
End
"read error at address 1700773832"
I tried it with the latest Beta and with the 4.10 of PB.
But anyway I must say that I love programming in PB
