Exctrating data from binary file - NEWBIE :(
Posted: Sat Jan 22, 2011 10:30 am
Hi to all !
First accept my apologies for maybe stupid and easy question...but simply, I do not know how do it.
Before one month I start to learn PB, reading book and documentation but do not have experience, still learning.
Problem is next, this is a binary file example which I want to load to buffer or just read , then do some mathematics
and then to show result in Textgadget.
AA 10 01 FF FF FF FF FF FF FF FF FF FF 1E 29 33
C7 D2 D1 FF FF FF FF 37 78 22 7D 27 7E FF FF 4B
A2 40 A0 24 0D 63 43 16 07 02 C1 81 31 55 32 37
31 31 66 99 FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
For showing result I use this command SetGadgetText(#Text_6, Text$). Main problem is how to read this kind of file or read it in buffer? I tried on this way but do not work.....sorry, that`s best what I can at this moment.
Procedure LoadF()
file$=OpenFileRequester("Please choose file...","","<*.bin> | *.bin", 0)
If file$
ReadFile(0,file$)
While Eof(0) = 0
Wend
CloseFile(0)
EndIf
EndProcedure
I know that problem is that before showing result I must have result as string, but....
Can You help me please and explain me how to think in future?
First accept my apologies for maybe stupid and easy question...but simply, I do not know how do it.
Before one month I start to learn PB, reading book and documentation but do not have experience, still learning.
Problem is next, this is a binary file example which I want to load to buffer or just read , then do some mathematics
and then to show result in Textgadget.
AA 10 01 FF FF FF FF FF FF FF FF FF FF 1E 29 33
C7 D2 D1 FF FF FF FF 37 78 22 7D 27 7E FF FF 4B
A2 40 A0 24 0D 63 43 16 07 02 C1 81 31 55 32 37
31 31 66 99 FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
For showing result I use this command SetGadgetText(#Text_6, Text$). Main problem is how to read this kind of file or read it in buffer? I tried on this way but do not work.....sorry, that`s best what I can at this moment.
Procedure LoadF()
file$=OpenFileRequester("Please choose file...","","<*.bin> | *.bin", 0)
If file$
ReadFile(0,file$)
While Eof(0) = 0
Wend
CloseFile(0)
EndIf
EndProcedure
I know that problem is that before showing result I must have result as string, but....

Can You help me please and explain me how to think in future?