I am frustrated about the situation that we cant put vals >127 into a byte and get it correct back... In my actual game project i need to read a lot of datas (bytes) with a val up to 255... i could save the data as word or long but this makes our exe bigger... I still hope that fred will fix this very imporatant point in the next release! Maybe var.ub or what ever... Please Fred!

Mhhh, here is a small example how to save your datas up to 255 - declared as word into a data section and read/handle it back as byte with correct vals up to 255... I am not very happy with this result but it works! Hope this help you...
Code: Select all
;------------------------------------
;
; Read/Handle Bytes correct up to 255
;
;------------------------------------
;
OpenConsole()
;
For i = 0 To 11 ; 12-1 = 11
Read ourbyte.b ; Here we read our data as byte!!! (saved as word!)
Read temp.b ; Read dummy byte temporary - We dont need this val
;
If ourbyte 127 we will put it in a new var And calc the correct val!
Else
xourbyte = ourbyte ; xourbyte is now the variable with the correct val! :wink:
EndIf
;
PrintN (Str(xourbyte))
Next
;
Sleep_ (8000)
;
CloseConsole()
;
End
;
;--------- TEST DATA SECTION ---------
;
DataSection: ; 12 data
;
Data.w 0, 30, 60, 90, 120, 127 ; Your byte data must be saved as word!!!
Data.w 128, 160, 190, 220, 250, 255 ; I am not happy with this, but it works! Wanted .b up to 255 ! Please!!!
;
EndDataSection:
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...
greetz
MrVainSCL! aka Thorsten