20x2 syntax error

Anyone know why this code generates an error report or how I should bypass. I have submitted an error report and note that something similar was submitted back in 2009.

Code:
#picaxe 20x2
	
	if b0 bit 0 clear then 'new  switch depression made
'		setbit b0 , 0 'set  flag
'		setbit b0,  7 'indicate switch change
	endif

end
The problem is in the IF statement. I have removed everything else.

I am using LineAxePad 1.5.0
 

Technical

Technical Support
Staff member
This is a known, bizarre one-off error with the Linux build of the compiler, to date we have not worked out why. 'Set' works but 'clear' doesn't.
Exactly the same source code is compiled on each platform, and both the Mac and Windows compilers work just fine with 'clear'.
 

hippy

Ex-Staff (retired)
As Technical notes it is bizarre that "Clear" works while "Set" does not, but that does provide a workround; instead of testing Clear and then executing the Then clause statements, one can test Set and then execute Else statements. For example, this will be the equivalent of the Clear code which gives an error -

Code:
if b0 bit 0 [b]set[/b] then 
  'no new switch depression
[b]else[/b] 
  'new switch depression made
  setbit b0 , 0 'set  flag
  setbit b0,  7 'indicate switch change
endif
 
hippy, thanks

For info I just re-entered my example code on another LinAxePad 1.5.0 and it complied ok.

Tried again from new on the original machine and the error is still there. Both 1.5.0 and Ubuntu 12.04. The one with the error was only installed today.

Grateful for the bypass.
 

hippy

Ex-Staff (retired)
@ Hundred1906 : Thanks for the info and it gets more bizarre all the time.

Same executables, in theory same 'everything', works okay in one case but not in others. Obviously there is something different going on, and it suggests something external to AXEpad and the compilers, but it is very hard to discover what or why.
 
Top