[Case 1]
OUTFILE "test_maroc.exe"
! Macro Add a B c; a macro that implements (a + B) * (a-B)
Intop $ R0 $ {A}-$ {B}
Intop $ R1 $ {A} + $ {B}
Intop $ {c} $ R0 * $ r1
! Macroend
/*
Note :! Macro and! Insertmacro usage:
! Macro Add a B c ;! Macro macro name parameter 1 parameter 2 parameter 3...
! Insertmacro add 10 20 $0 ;! Insertmacro macro name parameter 1 parameter 2 parameter 3...
In use! Insertmacro parameters will be substituted! Use in macro
Is like! Insertmacro add 10 20 $0
Substitute! Macro Add a B c
. In! Macro add is equivalent to executing
Intop $ R0 10-20
Intop $ R1 10 + 20
Intop $0 $ R0 * $ r1
*/
Section
! Insertmacro add 10 20 $0; macro call
Detailprint '$0'
Sectionend
Case 2]
Deletes a process with the specified name.
! Macro killprocess filename
$ {For} $ R1 0 2
Findprocdll: findproc $ {filename}
Intcmp $ R0 1 _ isexisted _ isnotexisted
_ Isexisted:
Killprocdll: killproc $ {filename}
Intcmp $ R0 0 _ is0 _ lessthan0 _ morethan0
_ Is0:
Goto _ end_of_kill_zhezi
_ Lessthan0:
_ Morethan0:
$ {Next}
_ Isnotexisted:
_ End_of_kill_zhezi:
! Macroend