can you use debug to write a value
Bruce King
Posts: 12
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
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
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.
What is the syntax to just make an input label true?
thanks
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