Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   linefind bug? (http://forums.winamp.com/showthread.php?t=242196)

sissy 30th March 2006 21:57

linefind bug?
 
Hi,

Probably my doing and not a bug...

Using the linefind callback function doesnt see !defines but will see Vars. Just calling a standard function works fine.

ie

!define DEF_NAME
Var VAR_NAME

...
set both values a bit later
...

Function LineFindCallback
MessageBox MB_OK "${DEF_NAME} def used"
MessageBox MB_OK "$VAR_NAME var used"
${WordReplace} "$R9" "old" "new" "+" $R9

Push $0
FunctionEnd

Is this normal behaviour or am i missing the picture?

Thanks.

goldy1064 31st March 2006 00:37

Are you trying to set the value of a define later on in your script with a runtime command? A define is a compile-time command, therefore it has to be set at compile-time with !define or redefined later on with !undef and !define.

sissy 31st March 2006 07:58

Quote:

Originally posted by goldy1064
Are you trying to set the value of a define later on in your script with a runtime command?
Yes using the .onInit

ReadRegStr ${COMPUTERNAME} HKLM "blah" "ComputerName"

What confuses me is that i can call a function with MessageBox MB_OK "${COMPUTERNAME}" at any stage after the .onInit and it works everytime but if LineFind calls the function it doesnt work unless its a Var and not !define.

So im really lost as to whats happening here :(

Thanks

sissy 31st March 2006 08:16

After further reading i think i understand whats happening now.

Thank you.

Afrow UK 31st March 2006 08:18

It might help if you attach the entire script. There isn't really much information here at this time.

-Stu


All times are GMT. The time now is 17:47.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.