Shop OBEX P1 Docs P2 Docs Learn Events
A DEBUG message based in a var count? — Parallax Forums

A DEBUG message based in a var count?

beazleybubbeazleybub Posts: 102
edited 2008-08-10 23:11 in BASIC Stamp
I have searched around but can't find any information on how to display a different message in the debug window based on the count of a variable.
I would like to only change a specific part of the information within the debug window without clearing the whole screen.

Like the example below the text that I would like to change based on a variable would be the green "Scroll value" and the purple "Exit?".

Can someone please show me an easier way to do this?

IF menulevelct <= 4 THEN

 
 DEBUG CLS,                                               ' display options menu
        "==============================",               CR,
        "           Menu Demo    ",                     CR,
        "          Menu Level (",DEC1 menulevelct, ")", CR,
        "==============================",               CR,
        " [color=green]Scroll Value[/color] (", DEC SettingLevel_ct, ")"
ELSE

 
 DEBUG CLS,                                               ' display options menu
        "==============================",               CR,
        "           Menu Demo    ",                     CR,
        "          Menu Level (",DEC1 menulevelct, ")", CR,
        "==============================",               CR,
        " [color=purple]Exit?[/color] (", DEC SettingLevel_ct, ")"
        ENDIF

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-10 22:39
    Look at the chapter in the Stamp Basic Manual on the DEBUG statement. There's a table on page 168 showing the control characters that the debug window responds to. One of them causes the cursor to go to a specific row and column. You can "paint" the background of the debug window with all the titles and boxes, then just position to a specific row and column and write the actual data. For example,

    DEBUG 2,16,2,DEC1 menulevelct

    This positions to column 17, row 3 and writes a single digit decimal value.
  • beazleybubbeazleybub Posts: 102
    edited 2008-08-10 22:45
    Thanks Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!
  • SRLMSRLM Posts: 5,045
    edited 2008-08-10 23:11
    If you are making a static screen except for the numbers you may want to put a value on your DEC statements (DEC3, DEC6, etc) so that the number doesn't jump around in size.
Sign In or Register to comment.