MacroOnce

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

MacroOnce

Post by GPI »

At the moment all macros are recursive. They work perfect, but there is one little problem: It is not possible to "replace" keywords like EndProcedure or ProcedureReturn, because this will cause an infinitive loop.

My Suggest, a additonal Macro-Type, MacroOnce. This macros are not recursive and will be handled before the actual macros.

for example

Code: Select all

Macro Test1234
  Debug "testoutput"
EndMacro

MacroOnce End
  Test1234
  End
EndMacroOnce
  
Debug "somestuff"
End

will result in

Code: Select all

debug "somestuff"
debug "testoutput"
end