Reference/IntCmp: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=IntCmp= val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more] Compares two integers val1 and val2. If val1 and val2 are equal, Gotos jump_if_equa...")
 
 
Line 16: Line 16:
   Goto done
   Goto done
done:</highlight-nsis>
done:</highlight-nsis>
''Command introduced with NSIS v1.50''

Latest revision as of 20:27, 4 June 2013

IntCmp

val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]

Compares two integers val1 and val2. If val1 and val2 are equal, Gotos jump_if_equal, otherwise if val1 < val2, Gotos jump_if_val1_less, otherwise if val1 > val2, Gotos jump_if_val1_more.

IntCmp $0 5 is5 lessthan5 morethan5
is5:
  DetailPrint "$$0 == 5"
  Goto done
lessthan5:
  DetailPrint "$$0 < 5"
  Goto done
morethan5:
  DetailPrint "$$0 > 5"
  Goto done
done:

Command introduced with NSIS v1.50