Restored from previous forum. Originally posted by Danilo.
Right !!
Its not only a wish, its a *must*.
Without Bytes being Bytes, and Words
being Words, PureBasic is useless
for many things.
There are 2 differnet things, you have
to look at:
1.) Commands that use the value
Thats mostly Frederic´s choice.
When Fred thinks the command Str() should
use Signed values, its his choice.
If he also provides a command StrU() for
Unsigned values, its great.
Thats not really the important part, because
we can write our own commands too.
2.) definition and value assignment
Thats the important part, because we cannot
change the compiler !! Only Fred can do that.
Bytes are Bytes in memory, and Words are Words -
the memory cell doesnt care if its signed or unsigned.
The BIG problem:
The compiler doesnt allow:
byte.b = 255
word.w = 65535
But hey, the thing is simple -
the Compiler must allow the following values:
Code: Select all
Bytes = -127 -> 255 ( -$7F -> $FF )
Words = -32767 -> 65535 ( -$7FFF -> $FFFF )
DWords = -2147483647 -> 4294967295 ( -$7FFFFFFF -> $FFFFFFFF )
Fred:
__Please__ change that in the compiler.
You dont have to change 1 PureBasic command
for that, only the allowed Range in the compiler.
Result:
You can still use -127 for Bytes, when you
need it. But you can also use the value 255
and $FF for bytes, for the functions that
need unsigned values (most API functions).
BTW: it already works for LONGs, because its
allowed to write variable.l = $FFFFFFFF (thats good).
But you can also write var.l = -$FFFFFFFF (not good).
For the right allowable values see above.
Thanks,
...Danilo
(registered PureBasic user)
Edited by - Danilo on 10 March 2002 23:20:21