P1 SPIN TO P2 SPIN
pic18f2550
Posts: 400
Hello,
The P2 cannot translate the P1:
PRI InBaseRange(Char, Base): Value ''Compare Char against valid characters for Base (1..16) (adjusting for lower-case automatically). ''Returns 0 if Char outside valid Base chars or, if valid, returns corresponding Value+1. Value := ( Value -= (Char - $2F) * (Char => "0" and Char =< "9") + ((Char &= $DF) - $36) * (Char => "A" and Char =< "F") ) * -(Value < ++Base) ^ | He always wants to put a bracket here. --+
How would I have to modify this to make it work?
Thanks.
Comments
JonnyMac has a doc which has the operators which require changing. Hope he will chime in.
IIRC => changes to >= etc
As Ray pointed out, just change => to >=, and =< to <=.
That said, I think this is a cleaner implementation (P2 version):
You have to come up with something like that first. "=> changes to >="
I didn't get that error, because I assumed that the parser would correct it.
Again what learned.
Thanks
I made the attached document for myself (it's based on another document Chip has posted) when I started porting my P1 code to the P2. Maybe it will help you. If you find any errors, please let me know.
Here's a link to the list Jon posted a while back. I refer to it often.
Thank you JonnyMac.