Hi Tim,
Thank you for your reply, but my example has mislead you somewhat,I'm afraid.
Macro substitution is something completely different from 'IF DEF's'
or '#INCLUDE'( if I do understand your explanation correctly).
It is rather a function that acts upon the content of a string variable as if it had been typed in on the command line.
example:
100 my_string$="qdos"
120 my_new_string$=XYZ("upper$"&"("&my_string$&")")
130 rem XYZ => name of the function that would do the trick
140 print my_new_string$
150 rem line 140 would not display "upper$"&"("&my_string$&")"
160 rem but "QDOS"

Sorry for the disturbance and thanks for your explanation
Fran�ois Van Emelen

Timothy Swenson wrote:

I don't believe there is a way of performing macro substitution in S*BASIC programming. Now, it can probably be implemented in one form or another.

The most obvious is a pre-processor that takes a macro and expands it before the program is actually sent to a compiler or parser. C has a pre-processor that does exactly this.

Another way to do it is to create a macro in a text editor that does the substitution for you. Either as a form of pre-processor, or as a keyboard shortcut.

I don't think it is possible inside S*BASIC, as this would require a change in the S*BASIC code.

Structured SuperBasic (SSB) is a form of pre-processor that does things like conditional compilation (IF DEF's), combining S*BASIC modules into one program (#INCLUDE statement), and so on. Some form of substitution could be implemented. If you feel adventure some, the SSB source code comes in the package and you can take it as a start and go from there.

Tim Swenson





Reply via email to