bfgstew
Senior Member
I would like to be able to input into a word variable a value of between 0001 and 9999, now I can do that as long as the value is above 0999, no problem, but when I input a value below 1000 I get 999 or 99 or 9 where I would like it to be 0999 or 0099 or 0009.
I currently use this code to get the value into it
And then display on an OLED,
Is there away of getting the leading zeros in place without to much alteration to the above code.
One more question, if this can be done how do I get the cursor to blink and move onto the next character to input, so I know where I am, I have tried but the cursor seems to just sit there and blink away rather than stepping to next character?
Any help would be grateful received as this is the last piece of the jigsaw for my project and would so like it to be finished.
Stewart
I currently use this code to get the value into it
Code:
serout B.7,baud,(254,1)
pause 500
serout B.7,baud,(254,128," NOW SET THE FLASH ")
serout B.7,baud,(254,192," DELAY ")
serout B.7,baud,(254,154,"FD -",254,159,#w8,"ms")
pause 100
For b33 = 1 to 4
Gosub GKP
if key_value = 12 then return endif
w8 = w8 * 10 + b1
serout B.7,baud,(254,159,#w8,"ms")
pause 30
next b33
Return
Is there away of getting the leading zeros in place without to much alteration to the above code.
One more question, if this can be done how do I get the cursor to blink and move onto the next character to input, so I know where I am, I have tried but the cursor seems to just sit there and blink away rather than stepping to next character?
Any help would be grateful received as this is the last piece of the jigsaw for my project and would so like it to be finished.
Stewart