I'm thinking about placeing two or more variables on the DEGUGode line.
Example: DEBUG DEC? X, DEC? Y, BIN? Z
I know that doesn't work and I've tried other punctuation. Nothing seem to work so I'm guessing you can't. Was just a thought being lazy.
I'm thinking about placeing two or more variables on the DEGUGode line.
Example: DEBUG DEC? X, DEC? Y, BIN? Z
I know that doesn't work and I've tried other punctuation. Nothing seem to work so I'm guessing you can't. Was just a thought being lazy.
Sure you can:
DEBUG "x = ", DEC x, " y = ", DEC y, CR
The above is a case where text and formatted numbers are output, and as you can see, there are 5 items on that line.
Welcome to the forums, wstafford. It is possible if you're still having issues that the PBASIC 2.5 directive is missing or malformed. Be sure to click the 2.5 icon in the editor toolbar to be sure you're using the PBASIC 2.5 syntax.
Sorry, by the way the question was written I couldn't tell if the code was meant for a BS1 or BS2 and usually ignore the 2.0 syntax altogether. In PBASIC 1.0 the formatters would be rejected, and in 2.5 they would not. Sometimes new programmers malform the syntax directive and some stuff doesn't compile right. It's just one of those heads up things. I think the editor defaults to 2.0 syntax if one isn't specified. In such cases perfectly formed code won't compile as expected or in some cases at all.
The following code should work perfectly fine and doesn't generate an error in the IDE, yet it will not run as expected. Just something I try to keep customers on their toes about.
' {$STAMP BS2}
' ($PBASIC 2.5)
DO
HIGH 1
PAUSE 100
LOW 1
LOOP
This can leave new programmers frustrated and I have had many tech calls with something similar. Simply clicking the 2.5 icon fixes this code example.
...errrrrr, I'm a bit surprised that the IDE wouldn't pick up the parens as an error. Or is it because the apostrophe marks the line as a comment? But if it's considered a comment, then how can it be a directive? But....and how.....and....aarrrRRGGHHH - my head's imploding!!!!
Well, consider the DO and LOOP also being ignored in 2.0 even though they're valid syntax in 2.5. So it's just good to always use those buttons on the toolbar when possible.
Comments
I'm not too clear on your question. I would suggest going here:
http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf
on page 159, and read up on the DEBUG command. It does support various forms of output formatting.
Example: DEBUG DEC? X, DEC? Y, BIN? Z
I know that doesn't work and I've tried other punctuation. Nothing seem to work so I'm guessing you can't. Was just a thought being lazy.
Sure you can:
The above is a case where text and formatted numbers are output, and as you can see, there are 5 items on that line.
Multiple items work just fine in my projects.
Would not the Stamp IDE catch that if the OP had selected v2.0?
The following code should work perfectly fine and doesn't generate an error in the IDE, yet it will not run as expected. Just something I try to keep customers on their toes about.
This can leave new programmers frustrated and I have had many tech calls with something similar. Simply clicking the 2.5 icon fixes this code example.