Archive: ${SYMBOL} and FindWindow strangeness


${SYMBOL} and FindWindow strangeness
The following code:
FindWindow ${MIRANDA_HWND} Miranda
gives me this error:
FindWindow expects 2-3 parameters, got 1.

$0 works. Why can't I do like this?

o_cee


You should use the variables $0-$9 and $R0-$R9, you cannot use your own variable names.


When is it not possible to use own variables?


o_cee


$0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $R0, $R1, $R2, $R3, $R4, $R5, $R6, $R7, $R8, $R9 are user variables, you should use them for the output of instructions such as FindWindow.

You can use ${SYMBOL} to globally define something, for example:
#define TEST 123
now ${TEST} will be replaced by 123


okay... imo it'd be possible to write cleaner more easily understandable code.. but maybe that's just me


Originally posted by o_cee
okay... imo it'd be possible to write cleaner more easily understandable code.. but maybe that's just me
That's right, but it's very diffucult to write such a system for NSIS.

You can define such a global value for nicer names.

For example:
!define HWND $0

Now ${HWND} will be replaced by $0 in the compiler.