How do we know what words are reserved?

Pongo

Senior Member
I discovered the hard way that it's not possible to have a subroutine called "readit", this code always fails with a not-very-helpful "Syntax error on line 2 at/before position 12". "readltc" is fine

Code:
main:
gosub readit
end
readit:
'blah
return
I assume "readit" is some kind of reserved word although I don't find it searching the pdf's. What are the rules for label names?
 

westaust55

Moderator
The rules for Labels are covered in PICAXE manual2 page 6.
Reserved words for labels, commands, keywords/parameters are listed in Appendices A, B and C

That said, the currently available manual is still that used for PE version 5.x and the PE at V6 will likely introduce some additional reserved words.
 

srnet

Senior Member
I assume "readit" is some kind of reserved word although I don't find it searching the pdf's. What are the rules for label names?
Reserved words should be listed in the manual, but readit does not appear to be there.

Although I never check the reserved list myself, if I get that syntax error, I just assume its beacause I am using a reserved word.
 

hippy

Technical Support
Staff member
Reserved words should be listed in the manual, but readit does not appear to be there.
We will have to investigate that. 'readit' is a shortform synonym for ReadInternalTemperature.
 

Dartmoor

Member
As a beginner, I have so far been using logicator which avoids this issue.
This weekend I tried my first basic program now that PE6 seems more stable.
I just got an 08M2 to read three ibuttons and flash the led a number of times to show which button it is (start of a bigger project).
Instantly I came across this problem because I copied part of the sample program from the data sheet - then found that you cannot have a sub-routine called 'loop' !!
 
Top