gencha
28th July 2010 13:04 UTC
Determine if variable is integer or string
I'm trying to extend the script at http://nsis.sourceforge.net/File_Association to allow me to specify an alternative DefaultIcon source. I would like to be possible to either pass an additional int (treated as the icon index in the executable) or a string (absolute location) to RegisterExtensionCall.
How do I determine that?
MSG
28th July 2010 13:14 UTC
Have you tried to use IntOp on it?
IntOp $1 $0 +1
IntOp $1 $1 -1
${If} $1 == $0
; is an integer
${EndIf}
Something like the above should work. Strangely, the manual doesn't state what happens if you intop a non-integer... But just play around and you'll figure it out.
gencha
28th July 2010 13:20 UTC
Thanks. I'll try it out.