Shop OBEX P1 Docs P2 Docs Learn Events
can you use debug to write a value — Parallax Forums

can you use debug to write a value

Bruce KingBruce King Posts: 12
edited 2005-12-04 15:32 in BASIC Stamp
I see the debug window has an area at the top for typing in....

what all can you do with this upper debug window?
I know how to use debug for monitoring and find nothing in the manual for this other area.
I need to set some variables true for testing purposes.

I have a BS2P40

Thanks!
Bruce

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2005-12-04 06:09
    Bruce,

    You could set the variables accordingly in the source code, or if you want to enter the values through the debug terminal, check out the DEBUGIN command in the Basic Stamp Editor help file.
  • Bruce KingBruce King Posts: 12
    edited 2005-12-04 14:36
    thanks for info but I do not see an example of a simple deposit.

    What is the syntax to just make an input label true?

    thanks
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-04 15:32
    Bruce -

    You can't just "set" a variable externally via the DEBUG facility. However, you can field a variable from the DEBUG terminal by use of DEBUGIN command. The syntax is simplicity itself:

    Syntax: DEBUGIN {data modifier} InputData

    Now a brief example, of how to field a variable and set an internal variable to that externally supplied value:

    {$STAMP BS2}
    {$PBASIC 2.5}

    datum var byte
    Int_var var byte

    DEBUG "Enter 0 or 1 to set internal variable:"
    DEBUGIN DEC1 datum

    Int_var = datum

    Or more simply, with no additional storage required:

    {$STAMP BS2}
    {$PBASIC 2.5}

    Int_var var byte

    DEBUG "Enter 0 or 1 to set internal variable:"
    DEBUGIN DEC1 Int_var

    The "DEC1" just limits the input data to one decimal digit. You can choose to do error checking or limit checking (just 0 or 1) as required. That's all there is to it.

    Regards,

    Bruce Bates
Sign In or Register to comment.