Archive: linefind bug?


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.


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.


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

After further reading i think i understand whats happening now.

Thank you.


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

-Stu