Like that:
Code: Select all
ff
Macro ff
Debug "hi!"
EndMacro
Code: Select all
ff
Macro ff
Debug "hi!"
EndMacro
Yes would be nice indeed.Psychophanta wrote:Not only before to be used.
Like that:Or allow the 'Declare' statement also for macros.Code: Select all
ff Macro ff Debug "hi!" EndMacro
Code: Select all
DeclareMacro My_Macro
a=My_Macro+1*My_Macro
Macro My_Macro
5
EndMacro
Of course! But what about this quick example:HanPBF wrote:But, declaration should always come before using things; that's from PASCAL and I think it's correct.
Code: Select all
Procedure Test1()
Test2()
; Do something
EndProcedure
Macro Test2()
; Do something else
EndMacro
This might be true on a compiler perspective. However as a programmer we're still addressing a macro by just its name, right?!Shield wrote:You can declare procedures because for a procedure call the function signature is the only thing that matters.
In the case with macros, you can't do that because with macros the entire content of the macro matters.
Code: Select all
Procedure MyOpenWindow(WindowID, x, y, ...)
Result = OpenWindow(WindowID, x, y, ...) ; This is the real OpenWindow() from PB
If Result
; Do awesome stuff here
EndIf
ProcedureReturn Result
EndProcedure
Macro OpenWindow(WindowID, x, y, ...)
MyOpenWindow(WindowID, x, y, ...)
EndMacro
If OpenWindow(...) ; this now calls the MyOpenWindow() procedure