in older versions of PB some tricks worked to shorten the source code using macros in a unusual way.
For example, I was able to replace macros with macros to save as much source code as possible. I remember the 20-line contest in 2009 here in the forum, where I used the following constellations in my sourcecode for example:
Code: Select all
Macro M(a,b):Macro a:b:EndMacr:EndMacro:M(H,"Hello world!")o:Debug H
But apart from that the user #Null and I noticed some "crazy" things when using macros in the current PB version.
For example this code works. The MessageRequester pops up and show "Hello World" as expected:
Code: Select all
Macro M(a,b):Macro a
b:EndMacro: M(C,"world"):EndMacro
sText.s = "Hello " + C:MessageRequester("", sText)
Something seems to be wrong when using a : after the last EndMacro.
Code: Select all
Macro M(a,b):Macro a
b:EndMacro: M(C,"world"):EndMacro:sText.s = "Hello " + C:MessageRequester("", sText)
If you execute the following macro code, then the defined macro "C" is not inserted where it is placed in the source code, but one line below it. In addition, a syntax error is now displayed when compiling, even though the code is valid.
Code: Select all
Macro M(a,b):Macro a:b:EndMacro
M(C,"world"):EndMacro
sText.s = "Hello " + C
MessageRequester("", sText)
Kind regards
Kurzer