Proton BASIC Community

Proton (Positron) => Beginners => Topic started by: Ivano on Oct 05, 2022, 11:32 AM

Title: Sbyte and sword
Post by: Ivano on Oct 05, 2022, 11:32 AM
Hello everybody,
it is the first time that I use negative numbers and I have not understood how to handle them.
In the manual it indicates sbytes from -128 to + 127.
If I write:
Dim A as sbyte
A = - 2
Print at 1,1, dec A
Appears on the LCD display
254 instead of - 2
Same behavior though
Dim A as byte
Do I have to do some other operation to handle negative numbers?
thank you
Title: Re: Sbyte and sword
Post by: John Lawton on Oct 05, 2022, 11:48 AM
Use SDEC
Title: Re: Sbyte and sword
Post by: Ivano on Oct 05, 2022, 03:34 PM
Quote from: John Lawton on Oct 05, 2022, 11:48 AMUse SDEC
How stupid, I had read it long ago in the manual but I did not remember it.
Thanks so much John