About File reading.
If I understand correctly, under purebasic, I may do this :
ReadByte.l = CallCFunctionFast( *DB_FileReadByte, ChannelID )
(*DB_FileReadByte is pointer to the ReadByte function)
because it's a function and not a command ... right ?
I tried this and it crash my app
Same for ReadString:
Procedure.s DBReadString( ChannelID.l )
Retour.l = CallCFunctionFast( *DB_FileReadString, ChannelID, @OldSTRING.s )
If Retour <> 0
RetourSTR.s = PeekS( Retour )
CallCFunctionFast( *GlobPtrCreateDeleteString, Retour, 0 )
Else
RetourSTR = ""
EndIf
ProcedureReturn RetourSTR
EndProcedure
EDIT:
In fact it was the ReadString that did crash:p
ReadByte,word and long work :
; *********************************************************************
Procedure.s DBReadString( ChannelID.l )
Retour.l = CallCFunctionFast( *DB_File\ReadString, ChannelID )
If Retour <> 0
RetourSTR.s = PeekS( Retour )
CallCFunctionFast( *GlobPtr\CreateDeleteString, Retour, 0 )
Else
RetourSTR = ""
EndIf
ProcedureReturn RetourSTR
EndProcedure