Old 24th July 2003, 11:42   #1
o_owd
Senior Member
 
o_owd's Avatar
 
Join Date: Feb 2003
Location: TGM, Romania
Posts: 176
Send a message via ICQ to o_owd Send a message via Yahoo to o_owd
!ifdef question

hello,

i have a question.
i searched the archive and the forum.
i need in my script a line like this

i have 6 variables that takes values : -1, 1, 0.
i need a condition (!ifdef i think) something like this :

!ifdef ($R2 == "0" | $R3 == "0" | $R4 == "0" | $R5 == "0" | $R6 == "0" | $R7 == "0")

but this does not work.
any ideas ?
i really need to check that all of them are "0".
o_owd is offline   Reply With Quote
Old 24th July 2003, 12:45   #2
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
If you want to test the value of "variables", you can use StrCmp, IntCmp or IntCmpU (see sections 4.9.4.18, 4.9.4.12 and 4.9.4.13 in the NSIS Users Manual).

!ifdef is used for testing "symbols" (see section 5.3 in the NSIS Users Manual)
pengyou is offline   Reply With Quote
Old 24th July 2003, 12:45   #3
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
!ifdef does compile time checking. Is that what you want?
If you need runtime checking using StrCmp domething like this:
StrCmp $R1 "0" 0 error
StrCmp $R2 "0" 0 error
StrCmp $R3 "0" 0 error
StrCmp $R4 "0" 0 error
StrCmp $R5 "0" 0 error
StrCmp $R6 "0" 0 error
#Do your other stuff here
goto done
error:
MessageBox MB_OK "Error"
done:

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 24th July 2003, 13:22   #4
o_owd
Senior Member
 
o_owd's Avatar
 
Join Date: Feb 2003
Location: TGM, Romania
Posts: 176
Send a message via ICQ to o_owd Send a message via Yahoo to o_owd
Quote:
Originally posted by iceman_k
...StrCmp $R1 "0" 0 error ...
it was in front of me and i could not see it...

i used StrCmp in my script (the same script, only a few lines lower) and i did not think of it...

thanks man...
o_owd 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