I`m having a lot of trouble trying to parse numbers bigger than 255,
I`v tried the SysCalcTempx originally, and it didn`t work so I tried it manually here:
Number = 255
If Number >= 1000 Then
Num1 = Number / 1000
Number = number - (num1*1000)
End If
If Number >= 100 Then
Num2 = Number / 100
Number = number - (num2*100)
End If
If Number >= 10 Then
Num3 = Number / 10
Number = number - (num3*10)
End If
num4=number
this code Should, be able to take a 4 digit number, and then parse these as individual digits that I can put into a display, but any number greater than the 255 show, screws everything up, for instance 256 displays 250.
is SyscalctempX a 16 bit variable, it would be nicer to use that if it is?
am i using the casting correctly?
basically I really cant see Why the above doesn`t work?
help please! :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I`m having a lot of trouble trying to parse numbers bigger than 255,
I`v tried the SysCalcTempx originally, and it didn`t work so I tried it manually here:
Number = 255
If Number >= 1000 Then
Num1 = Number / 1000
Number = number - (num1*1000)
End If
If Number >= 100 Then
Num2 = Number / 100
Number = number - (num2*100)
End If
If Number >= 10 Then
Num3 = Number / 10
Number = number - (num3*10)
End If
num4=number
this code Should, be able to take a 4 digit number, and then parse these as individual digits that I can put into a display, but any number greater than the 255 show, screws everything up, for instance 256 displays 250.
is SyscalctempX a 16 bit variable, it would be nicer to use that if it is?
am i using the casting correctly?
basically I really cant see Why the above doesn`t work?
help please! :)
look at the lcd.h file for a good example in the "sub print"
the lcd.h file is in the directory \GCBASIC\include\lowlevel\lcd.h
Thanks, I see where I was going wrong now, I didn`t put in the "Dim SysCalcTempX As word" line.
I thought it was a Comment :)