Page 1 of 1

[Implemented] Signed Byte

Posted: Sun Apr 13, 2003 7:27 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

Ok, that word and long are signed makes sence, but why are byte signed?

Normaly a Byte is used in the Rang from 0 to 255 and to from -127 to 128.

It would be nice to have a .ub -Type or, i think it is easier, a compiler-command like:

CompilerUseSignedByte
and
CompilerUseUnSignedByte

So the the programm can switch between the two possibilities.

for example:

Code: Select all

  CompilerUseUnSignedByte
  a.b=255
  debug a.b ; will return 255
  compilerUseSignedByte
  debug a.b ; will return -1
Also nice would be:

compilerUseUnsignedWord
compilerUseUnsignedLong

(but please don't switch all, .b.l.w at once. i only want to have a unsigned byte and signed words and long.)

Thanks.

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Sun Apr 13, 2003 9:06 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.

Why not .ub .uw and .ul? Maximum flexibility.

Posted: Mon Apr 14, 2003 5:42 am
by BackupUser
Restored from previous forum. Originally posted by THCM.

Yes, that would be cool! It took me some time till i found, that Bytes are signed! I peeked the Leveldata from my game and wanted to test if the byte is 255 and nothing happend.... silly of me!

Bye

The Human Code Machine / Masters' Design Group

Posted: Fri Apr 18, 2003 9:25 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

Btw: A good Solution

Code: Select all

a.b=240      ; this works fine
debug a.b    ; but this gives a negativ value
debug a.b$FF ; this not :)
a real .ub would be a better solution

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB