NSIS/Docs/src/int.but
2019-10-04 19:54:56 +00:00

72 lines
No EOL
2.1 KiB
Text

\S1{intinst} Integer Support
\S2{intfmt} IntFmt
\c user_var(output) format numberstring
Formats the number in "numberstring" using the format "format", and sets the output to user variable $x. The format string supports the same syntax as \W{https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-wsprintfw}{wsprintf} except that the \cw{I[32|64]} length fields and the \cw{p} type are not supported. Example format strings include "%08X" and "%u".
\c IntFmt $0 "0x%08X" 195948557
\c IntFmt $1 "%c" 0x41
\S2{int64fmt} Int64Fmt
\c user_var(output) format numberstring
Supports the \cw{I} and \cw{I64} length fields and the \cw{p} type in addition to the syntax supported by \cw{IntFmt}.
\NsisFuncReq64
\c Int64Fmt $0 "%I64x" 244837743786702
\# InternalNote: There is no IntPtrFmt instruction because "%p" is 2000+ and "%Ix" is XP+. Consequently, all code needs to check ${NSIS_PTR_SIZE}.
\S2{intop} IntOp
\c user_var(output) value1 OP [value2]
Combines value1 and (depending on OP) value2 into the specified user variable (\c{user_var}). OP is defined as one of the following:
\b \e{+} ADDs value1 and value2
\b \e{-} SUBTRACTs value2 from value1
\b \e{*} MULTIPLIEs value1 and value2
\b \e{/} DIVIDEs value1 by value2
\b \e{%} MODULUSs value1 by value2
\b \e{|} BINARY ORs value1 and value2
\b \e{&} BINARY ANDs value1 and value2
\b \e{^} BINARY XORs value1 and value2
\b \e{<<} LEFT SHIFTs value1 by value2
\b \e{>>} ARITHMETIC RIGHT SHIFTs value1 by value2
\b \e{>>>} LOGICALLY RIGHT SHIFTs value1 by value2
\b \e{~} BITWISE NEGATEs value1 (i.e. 7 becomes 4294967288)
\b \e{!} LOGICALLY NEGATEs value1 (i.e. 7 becomes 0)
\b \e{||} LOGICALLY ORs value1 and value2
\b \e{&&} LOGICALLY ANDs value1 and value2
\c IntOp $0 1 + 1
\c IntOp $0 $0 + 1
\c IntOp $0 $0 << 2
\c IntOp $0 $0 ~
\c IntOp $0 $0 & 0xF
\S2{intptrop} IntPtrOp
\c user_var(output) value1 OP [value2]
Combines value1 and (depending on OP) value2 into the specified user variable (\c{user_var}). OP is the same list of operators as supported by \c{IntOp}.
\c IntPtrOp $FieldAddress $MyBuffer + $FieldOffset