Old 7th May 2007, 18:15   #1
neil.benn
Junior Member
 
Join Date: May 2005
Posts: 8
LogicLab loops

Hello,

I just discovered the logiclab header which looks like it will really help me to produce more readable code. So I tried to use it and have come into problems. Here is what I have done :

At the top of the file, I have the line

!include "LogicLib.nsh"

Later on I have the following function (cut down to a smaller example) :

Function ModifyShortcutFile

;we need to get the machine list and tokenise it
StrCpy $1 "DropPaq"
StrCpy $2 ".lnk"
StrCpy $LOOP_COUNT 0

${Do}
StrCpy $9 ""
${StrTok} $R0 ${MACHINE_LIST} "|" $LOOP_COUNT 1
IntOp $LOOP_COUNT $LOOP_COUNT + 1
${If} $R0 == ``
${ExitDo}
StrCpy $9 "$1 $R0$2"
DetailPrint "Accessing PDA for $R0 on file $9"

${Loop}

FunctionEnd

However when I attempt to compile this, I get the following error:

[exec] FunctionEnd
[exec] Function: "ModifyShortcutFile"
[exec] StrCpy $1 "DropPaq" () ()
[exec] StrCpy $2 ".lnk" () ()
[exec] StrCpy $LOOP_COUNT "0" () ()
[exec] !insertmacro: _Do
[exec] !insertmacro: end of _Do
[exec] StrCpy $9 "" () ()
[exec] !insertmacro: StrTok
[exec] Push: wellmate
[exec] Push: |
[exec] Push: $LOOP_COUNT
[exec] Push: 1
[exec] Call "StrTok"
[exec] Pop: $R0
[exec] !insertmacro: end of StrTok
[exec] IntOp: $LOOP_COUNT=$LOOP_COUNT+1
[exec] !insertmacro: _If
[exec] !insertmacro: end of _If
[exec] !insertmacro: _Goto
[exec] !insertmacro: end of _Goto
[exec] StrCpy $9 "$1 $R0$2" () ()
[exec] DetailPrint: "Accessing PDA for $R0 on file $9"
[exec] !insertmacro: _Loop
[exec] !error: Cannot use Loop without a preceding Do
[exec] Error in macro _Loop on macroline 4
[exec] Error in script "C:\Documents and Settings\Neil Benn\My Documents\svn_new\trunk\DropPaq/installer/CE/DropPaq CE.nsi" on line 254 -- aborting creation process

I can't work out what, I'm doing wrong - I took a look at the macro in StrTok which has an examaple of the LogicLab headers and I think I am doing the right thing but I'm not sure.

Apologies for the length of this post - I hope you can help and thanks for reading this far.

Cheers,

Neil
neil.benn is offline   Reply With Quote
Old 7th May 2007, 19:28   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
code:
${If} $R0 == ``
${ExitDo}
${EndIf}


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 7th May 2007, 19:54   #3
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
You don't have an '${EndIf}' before the ${Loop} - I guess you want that after the ${ExitDo} line.
demiller9 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump