MACROs with AXEPad

benny226518

New Member
Good Evening. I'm trying to use macros with AXEPad V1.5.1 on Linux and the following simple construct:

#MACRO test
#ENDMACRO

results in the message "Error: syntax error".
Can anyone explain why this is happening??
 

techElder

Well-known member
AXEpad is really about as dead as Windows XP. Still works, but there's not going to be any more for it.

There, somebody has said it out loud. :D
 

hippy

Senior Member
TIC or not, I'm guessing PICAXE is not going to support those who choose to use other OS'. That would be a shame.
We try to support users of other operating systems; AXEpad and command line compilers for Linux and Mac are evidence of that. We are also providing PICAXE support for the multi-platform Visual Studio Code development environment -

http://www.picaxe.com/Software/Third-Party/Visual-Studio-Code

Installation of PICAXE extensions is currently less than optimal but we are pursuing ways of making that easier for end-users of PICAXE products.
 

benny226518

New Member
I installed Visual Studio but haven't had a chance to read and play yet. I did notice it had a compilers directory (same as AXEPad) so decided to try my two-liner directly from the command line. Same error.
Can I assume that VS will use these compilers?? If so, then the not supporting macros problem lay with the compilers and not AXEPad.
 

hippy

Senior Member
Can I assume that VS will use these compilers?? If so, then the not supporting macros problem lay with the compilers and not AXEPad.
Macros are handled through PE6 by using a PICAXE pre-processor. PE6 passes source code to the pre-processor, which processes macro expansion, and the resultant expanded code is passed to the compilers.

AXEpad, and currently Visual Studio Code, do not call the pre-processor but call the compilers directly.

The fault is not with the compilers, which are not intended to perform macro expansion. The fault could be said to lie with AXEpad in not calling the pre-processor, but doing so was never a part of its specification.

We may investigate how both the pre-processor and compilers could be integrated with Visual Studio Code if that were required but at the current time the PICAXE extension for Visual Studio Code invokes the compilers directly.
 

benny226518

New Member
Thanks for the detailed response however now I'm confused.
The "#PICAXE" command is a pre-processor command (as per page 8 in part 2 of the manual) and is supported by the compilers.
I haven't tested fully but "#DEFINE" also doesn't throw an error.
If the compilers aren't calling the pre-processor, why do these work??
It would be helpful if the documentation showed exactly what command was supported by what development program.
 

hippy

Senior Member
The compilers support a subset of directives which are pre-processor directives, but in a more limited way than the pre-processor does. For example the compilers only understand the "#DEFINE symbol" construct, not the more advanced "#DEFINE name expansion" the pre-processor allows.

It possibly would help to explictly note that #MACRO, #DEFINE and 'ppp_*' expansions, #INCLUDE, #IF and #ELSEIF directives are not available when the pre-processor is not used or not available. I will make a note of that.

As far as I am aware; those are the only things which require pre-processor support.
 
Top