
Originally Posted by
tazntex
Yes Joe that is a typo in the copy and paste. When I read all the replies with example code how are ya'll inserting the code block whereas I am just copying and pasting my code to this reply. I am assuming, which I don't like to do, that under additional options I could attach my questionable code.
Check out this page for all the neat stuff here on the forums:
http://www.picbasic.co.uk/forum/misc...bbcode#imgcode
(take out the extra spaces here)
[ code ]This will go in a code block[ / code ]
Code:
This will go in a code block
And there's a bunch more formatting type stuff listed on that page linked above.
What does the DEC mean and do? In the manual I understand it to be Decimal as in MYDATA would be recieved as a decimal.
It actually means that SERIN (or whatever) will wait until it receives x characters to be interpreted as a decimal.
For instance:
SERIN xxx,xxx,xxx, [ DEC1 x ]
Waits for a single character between "0" and "9", preceeded by a character that's not between "0" and "9" and followed by another character that's not between "0" and "9".
Another for instance:
SERIN xxx,xxx,xxx, [ DEC5 x ]
Waits for 5 consecutive characters that are each between "0" and "9", preceeded by any character that's not between "0" and "9" and followed by another character that's not between "0" and "9".
So, the DEC (or HEX or BIN) modifier actually does 'parsing' of an input stream for you.
HEX would wait for ASCII characters between "0" and "9" in addition to "a" (or "A") through "f" (or "F").
BIN would only wait for "0" and "1".
For reference..."0" = ASCII code 48 ($30), "9" = ASCII code 57 ($39), and so on. Just so we're on the same page here.
Bookmarks