diff --git a/Examples/LogicLib.nsi b/Examples/LogicLib.nsi index 824bb45c..ce7574b9 100644 --- a/Examples/LogicLib.nsi +++ b/Examples/LogicLib.nsi @@ -440,6 +440,15 @@ Section /o "Run tests" TESTS DetailPrint "FAILED For[Each]..Next test" ${EndIf} + ; do..loop + StrCpy $R1 0 + Call DoLoop + ${If} $R1 == 5 + DetailPrint "PASSED Do..Loop test" + ${Else} + DetailPrint "FAILED Do..Loop test" + ${EndIf} + ; do..exitdo..loop StrCpy $R1 0 StrCpy $R2 "" @@ -596,4 +605,15 @@ Function ComponentsLeave ${EndIf} FunctionEnd +Function DoLoop + + ${Do} + IntOp $R1 $R1 + 1 + ${If} $R1 == 5 + Return + ${EndIf} + ${Loop} + +FunctionEnd + !verbose 3 diff --git a/Include/LogicLib.nsh b/Include/LogicLib.nsh index 326417a2..9e78e425 100644 --- a/Include/LogicLib.nsh +++ b/Include/LogicLib.nsh @@ -576,6 +576,7 @@ !endif !undef _c=${_c} Goto ${_Continue} ; Just to ensure it is referenced at least once + Goto ${_Exit${_n}} ; Just to ensure it is referenced at least once ${_Exit${_n}}: ; Place the loop exit point !undef ${_Logic}Condition !insertmacro _PopScope Continue