Skip to content
⌘ NSIS Forum Archive

compare strings

3 posts

Dj Nyx#

compare strings

Hi
following problem:

in my setup i have to compare 2 strings... but i'd to make it like in other programming languages...

[like this:
if string1 = strin2 then
!insertmacro bla_bla_bla
else 
!insertmacro nz_nz_nz 
]
is there any way to do this that way?

or is there any chance to do it like this...

strcmp string1 string2 !insertmacro bla !insertmacro nz 
deguix#
4.9.4.19 StrCmp
str1 str2 jump_if_equal [jump_if_not_equal]

Compares (case insensitively) str1 to str2. If str1 and str2 are equal, Gotos jump_if_equal, otherwise Gotos jump_if_not_equal.
I.e.:

StrCmp "OH" "blablabla" 0 +10
Comm@nder21#
another example:

!macro macro_notequal
!macroend
!macro macro_equal
!macroend
Section "dummy_section" dummy_index
StrCmp "$1" "$2" equal
!insertmacro macro_notequal
Goto end
equal:
!insertmacro macro_equal
end:
SectionEnd