Simple loop testing macro: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
m (→‎Usage: <highlight-nsis>)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{|align=right
{{PageAuthor|Afrow UK}}
|<small>Author: [[{{ns:2}}:Afrow UK|Afrow UK]] ([[{{ns:3}}:Afrow UK|talk]], [[{{ns:-1}}:Contributions/Afrow UK|contrib]])</small>
 
|}
<br style="clear:both;">
== Description ==
== Description ==
This simply shows a MessageBox with OK and Cancel buttons for use in loops which are infinitely looping. You pass it a string which can contain variables to test. When pressing cancel, the installer will abort.
This simply shows a MessageBox with OK and Cancel buttons for use in loops which are infinitely looping. You pass it a string which can contain variables to test. When pressing cancel, the installer will abort.


== Usage ==
== Usage ==
<highlight-nsis>
${LoopTest} "$R0, $R1, $R2"
${LoopTest} "$R0, $R1, $R2"
</highlight-nsis>


== The Macro ==
== The Macro ==
Line 17: Line 17:
!define LoopTest "!insertmacro LoopTest"
!define LoopTest "!insertmacro LoopTest"
</highlight-nsis>-Stu
</highlight-nsis>-Stu
[[Category:Flow Control Functions]]

Latest revision as of 15:12, 14 January 2016

Author: Afrow UK (talk, contrib)


Description

This simply shows a MessageBox with OK and Cancel buttons for use in loops which are infinitely looping. You pass it a string which can contain variables to test. When pressing cancel, the installer will abort.

Usage

${LoopTest} "$R0, $R1, $R2"

The Macro

!macro LoopTest Message
 MessageBox MB_OKCANCEL|MB_ICONINFORMATION "${Message}" IDOK +2
  Abort
!macroend
!define LoopTest "!insertmacro LoopTest"

-Stu