Archive: goto bug ?


goto bug ?
Hi, before, sorry my english :p

i have a problem with IfFileExist istruction

this is the script

Function .oninit
ReadINIStr $R0 "$EXEDIR\config.ini" "GCF" "HL2"
IfFileExists "$EXEDIR\$R0.7z" +3 (in the test the file exist)
!insertmacro UnSelectSection "${SecHL2}"
SectionSetText ${SecHL2} ""

ReadINIStr $R0 "$EXEDIR\config.ini" "GCF" "DOD"
etc. etc. etc.
FunctionEnd

+3 in the "IfFileExists "$EXEDIR\$R0.7z" +3" don't work, don't jump at "ReadINIStr $R0 "$EXEDIR\config.ini" "GCF" "DOD"" string

why ?

tnx for help


Macros can contain more than one command. When jumping over macros, use labels.


tnx :)


I think we can also use LogicLib.nsh here cant we?

${If} ${FileExists} "${__FILE__}"

ReadINIStr $R0 "$EXEDIR\config.ini" "GCF" "DOD"

${EndIf}


Of course, but it uses labels too ;)


yep but labels are often messy and sometimes require other commands like goto etc ...and many lines of code can be reduced with logiclib...I love the damn thing :)


many lines of code???
did u ever look into the logic lib file? there are at least twice the lines of code, than you would have if you wrote your own specific optimized code.
that's because the logic lib is for universal usage.


hello?

I was just refering to length of the script..not all the associated libs etc...I have made some scripts alot shorter and cleaner using it was all i meant.Spefically when many strcmp statements are made etc..


Comm@nder21 was only pointing out that LogicLib may shorten your NSIS script, but would lengthen run-time execution (unnoticeably of course) because it adds a lot of code into the script on compile in order for it to function correctly.

-Stu


The LogicLib header file might contain lots of lines of code, but almost all of them are preprocessor lines. The end result is very similar to what you'd get if you write the code on your own. For example, ${If} $0 == $0 translates into one simple StrCmp.