Code: Alles auswählen
Macro CompIf
CompilerIf 0
EndMacro
Macro MyMacro
CompilerIf #PB_Compiler_Debugger
CompilerEndIf
EndMacro
CompIf
CompilerEndIf
MyMacro
Code: Alles auswählen
Macro CompIf
CompilerIf 0
EndMacro
Macro MyMacro
CompilerIf #PB_Compiler_Debugger
CompilerEndIf
EndMacro
CompIf
CompilerEndIf
MyMacro
Nach dieser Beschreibung wird der 'Platzhalter' des Makros einfach durch den 'Makrocode' ersetzt und dann das Programm abgearbeitet. In diesem Fall würde der Code nach Auflösen des Makros CompIf wie folgt aussehen und wäre OkHilfe hat geschrieben:Ein Makro ist ein Platzhalter für etwas Code (ein Schlüsselwort, eine Zeile oder auch viele Zeilen), welcher (beim Kompilieren) direkt an der Stelle, wo das Makro aufgerufen wird, in den Programmcode eingefügt wird.
Code: Alles auswählen
Macro MyMacro
CompilerIf #PB_Compiler_Debugger
CompilerEndIf
EndMacro
CompilerIf 0
CompilerEndIf
MyMacro