Reference/StrCmp: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=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 ...")
 
m (<code> format)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
  str1 str2 jump_if_equal [jump_if_not_equal]
  str1 str2 jump_if_equal [jump_if_not_equal]


Compares (case insensitively) str1 to str2. If str1 and str2 are equal, [[Reference/Goto|Gotos]] jump_if_equal, otherwise [[Reference/Goto|Gotos]] jump_if_not_equal.
Compares (case insensitively) <code>str1</code> to <code>str2</code>. If <code>str1</code> and <code>str2</code> are equal, [[Reference/Goto|Gotos]] <code>jump_if_equal</code>, otherwise [[Reference/Goto|Gotos]] <code>jump_if_not_equal</code>.


<highlight-nsis>StrCmp $0 "a string" 0 +3
<highlight-nsis>StrCmp $0 "a string" 0 +3
Line 9: Line 9:
Goto +2
Goto +2
DetailPrint '$$0 != "a string"'</highlight-nsis>
DetailPrint '$$0 != "a string"'</highlight-nsis>
''Command introduced with NSIS v1.2g''

Latest revision as of 14:51, 13 December 2017

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.

StrCmp $0 "a string" 0 +3
DetailPrint '$$0 == "a string"'
Goto +2
DetailPrint '$$0 != "a string"'

Command introduced with NSIS v1.2g