It would be really neat if PureBasic could include support for unsigned integer types. Especially with networking tasks (using Structures to read/write the memory) and easy value comparision it would be useful.
Trond wrote:.c behaves like an unsigned type, but it's only for byte/word.
I know, and it changes it's size with Unicode enabled/disabled. It's a special length type like .s{N}, too. Thats why I would like to have additional types.
It's not the first time this was requested and I think this is still a very important feature request. I'm writing all my C64 tools like packers and converters with Purebasic and it would be a lot easier having unsigned integer types.
For me, the main reason is stepping through byte values in a memory block. A few times with encryption, compression and sorting algorithms etc you use the byte value as a an array index for fast lookups.
If the byte value is over 127 then the number goes negative causing an array out of bounds. The whole purpose of these is speed so the &ff methods and not only ugly but I would guess slower in long tight loops.
.c is effectively useless for this purpose unless you want to ban yourself from using unicode (while is what I've done for the moment)
I read a lot of other posts and heard that there were casting issues etc for comparisons.... Other languages seem to do this fine though. (I'm not saying it's easy, just possible) Powerbasic had no problem with it.
Please consider
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Great ideas, I'd also like to be able to handle byte values without additional ANDs and ORs...
...AND (OR ) some type casting functions, like BYTE{} would be fine!
THCM wrote:It's not the first time this was requested and I think this is still a very important feature request. I'm writing all my C64 tools like packers and converters with Purebasic and it would be a lot easier having unsigned integer types.
[+1]
I do similar, but not only for C64, but for many other retro Computers, mainly ZX Spectrum.
I suspect that since this has been requested so long ago that there is some issue here making it difficult to implement...
Perhaps if PB are looking for a topic of their next blog article they might consider going through it for us
Worth a try
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
I think people notice it's absence before they purchase though, but I doubt many change their purchasing decision because of it
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein