If Then
Lowtide
Posts: 12
I cut and pasted the following sample code from·syntax guide. When I run it I get an " expected label" message next to the Then. What am I missing?
value·· VAR···· Word
Main:
· DO
··· PULSIN 0, 1, value························· ' measure pulse input
··· DEBUG DEC value, CR
··· IF (value > 4000) THEN····················· ' evaluate duration
····· DEBUG "Value was greater than 4000"
··· ELSEIF (value = 4000) THEN
····· DEBUG "Value was equal to 4000"
··· ELSE
····· DEBUG "Value was less than 4000"
··· ENDIF
··· DEBUG CR, CR
··· PAUSE 1000
· LOOP
value·· VAR···· Word
Main:
· DO
··· PULSIN 0, 1, value························· ' measure pulse input
··· DEBUG DEC value, CR
··· IF (value > 4000) THEN····················· ' evaluate duration
····· DEBUG "Value was greater than 4000"
··· ELSEIF (value = 4000) THEN
····· DEBUG "Value was equal to 4000"
··· ELSE
····· DEBUG "Value was less than 4000"
··· ENDIF
··· DEBUG CR, CR
··· PAUSE 1000
· LOOP
Comments