Quick question about value display in Debug
Joey M
Posts: 2
I am new.... and would like to be directed on how or where I might find out how to display a decimal value in the debug of a BS2 stamp kit I.E.· 7.87 rather than 787.
Thanks for any help
Thanks for any help
Comments
It really depends on how the value is stored…Typically you would have to display the whole number part and decimal part separately using two DEC statements with the period (decimal point) in between. Can you post the code or raw value of the variable which has the information?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I ahve included te code but removed non pertinate sections.
COUNTER····· VAR··· Byte
TIMER······· VAR··· Word
· DO
· HOLD:·········································· ' Random number until the button is pressed.
······ RANDOM RESULT
······ BUTTON IN5, 0, 0, 10, BTN_WRK, 0, HOLD
· LOOP UNTIL IN13 = 1
· FOR COUNTER = 1 TO 10
· 'DEBUG DEC RESULT, "· RESULT VALUE BEFORE LOOP. ",CR
· TIMER = TIMER + 1
· 'DEBUG· DEC TIMER, " TIMER VALUE.",· CR
' Section removed.....................
·SELECT
' More stuff with a TIMER counter removed..................
·ENDSELECT
······· NEXT
······ DEBUG CLS
······ DEBUG " Your total time was ", DEC TIMER + 4000 / 10 ,CR,CR···· ' This is the value I want to display as····· seconds. tenths
You help is appriciated. PS. I have review the manual but I think I am so new I just can interperate the definitions.
·