Time to Refresh this thread.
Apart from optimizing code...
Macro's can be a lifesaver when it comes to readability of your code.
--------------------
a=peekint(database,xpos+width*Ypos)
Using a macro like:
MakeMacro Getitem(peekint (database,xpos+width*Ypos))
that would become:
a=Macro Getitem
or even:
a=Getitem
----------------------
or:
----------------------
If A<Backup then A=C*Backup+SaveCount
If B<Backup then B=D*Backup+SaveCount
Using a Macro like:
MakeMacro SaveCheck(If {2}<Backup then {2}={1}*Backup+SaveCount)
one would get:
Macro SaveCheck({C},{A})
Macro SaveCheck({D},{B})
or even:
SaveCheck({C},{A})
SaveCheck({D},{B})
---------------------
[edit]
Since Macro's just replace texts one could do something silly like:
--------------------
MakeMacro UnScramble(Print {2}{1})
then,
UnScramble({o World"},{"Hell})
would result in:
Hello World
--------------------
I have found ThirdPartyEditors for other languages (including BB) that make use of Macro's, but not yet for BMax.
I wonder why, because its seems simple to implement in the IDE.
Apart from optimizing code...
Macro's can be a lifesaver when it comes to readability of your code.
--------------------
a=peekint(database,xpos+width*Ypos)
Using a macro like:
MakeMacro Getitem(peekint (database,xpos+width*Ypos))
that would become:
a=Macro Getitem
or even:
a=Getitem
----------------------
or:
----------------------
If A<Backup then A=C*Backup+SaveCount
If B<Backup then B=D*Backup+SaveCount
Using a Macro like:
MakeMacro SaveCheck(If {2}<Backup then {2}={1}*Backup+SaveCount)
one would get:
Macro SaveCheck({C},{A})
Macro SaveCheck({D},{B})
or even:
SaveCheck({C},{A})
SaveCheck({D},{B})
---------------------
[edit]
Since Macro's just replace texts one could do something silly like:
--------------------
MakeMacro UnScramble(Print {2}{1})
then,
UnScramble({o World"},{"Hell})
would result in:
Hello World
--------------------
I have found ThirdPartyEditors for other languages (including BB) that make use of Macro's, but not yet for BMax.
I wonder why, because its seems simple to implement in the IDE.