Shop OBEX P1 Docs P2 Docs Learn Events
Quick question about value display in Debug — Parallax Forums

Quick question about value display in Debug

Joey MJoey M Posts: 2
edited 2007-12-10 21:31 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-12-10 20:37
    Joey,

    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
  • Joey MJoey M Posts: 2
    edited 2007-12-10 21:31
    Thanks for the feedback.

    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.
    ·
Sign In or Register to comment.