Macro Problem

GY44

New Member
I need some advice/help in resolving the issue I have with inclusion of Macros in
Picaxe programs. My setup works fine for all programs that DO NOT have a Macro in the
.bas file. When there is a Macro, I get an error message when I try to check syntax. The
message says ;-
------------------------------------------------
Syntax Check Failed

#Macro SendToLCD
^
Syntax error on line 75 at/before position 1

Error: syntax error
-------------------------------------------------
Listed below is the first Macro in a file from --- axe133-18M2driver-4bit-freeconfig4.bas by
Jurjen Krakenborg (28-12-21)
-----
; Do not change this macro ...
#Macro SendToLCD
DB7 = bit7
DB6 = bit6
DB5 = bit5
DB4 = bit4
pulsout enable,1
DB7 = bit3
DB6 = bit2
DB5 = bit1
DB4 = bit0
pulsout enable,1
#EndMacro
-------------------------------------------------
This error message has appeared in many other programs with Macros

My Setup:-
PE 6.1.0.0 , AXE027 cable, Win10 , Dell laptop (2019)
 

hippy

Technical Support
Staff member
If you go into "File -> Options", select the "Compiler" tab, there should be a "BASIC Pre-Processor - Use pre-processor" checkbox up at the top. Ensure that is ticked, then click "OK".

Hopefully it wasn't ticked and ticking it will solve the issue. If not it will require deeper investigation.
 

kranenborg

Senior Member
I hope so too, as the author of the code I downloaded the code again and checked it, it compiled fine ... . Then, "unticked" the compiler option and indeed the same issue played up!
/Jurjen
 

Flenser

Senior Member
This issue sounds weird.

I just downloaded axe133-18M2driver-4bit-freeconfig4.bas from the forum, opened it in PE 6.1.0.0 on my Win7 laptop and did a verify with no issue:
25547
 

kranenborg

Senior Member
Yep, so this strongly supports Hippy's analysis. Still a bit surprised that such a small detail hidden deeply in the options list would affect a new member of this forum ... .
 

hippy

Technical Support
Staff member
Still a bit surprised that such a small detail hidden deeply in the options list would affect a new member of this forum ... .
I believe the box is ticked by default, but I recall that if one launches 'PE6 for Logicator' it gets unticked. Exploring options or trying things out may have led to it accidentally being unticked. You would never notice until you come to use something with a #MACRO in it.
 

GY44

New Member
Problem Solved !! I did exactly as you said Hippy. I found the "Use Basic Pre-Processor" box UNchecked, so I checked it and now I am able
to run the syntax check without any problems.
Many thanks for the help Hippy and also kranenborg and Flenser.
Regards
GY44
 

hippy

Technical Support
Staff member
Great to hear you are back on-track and thanks for letting us know.
 
Top