Old 30th March 2006, 21:57   #1
sissy
Junior Member
 
Join Date: Mar 2006
Posts: 15
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.
sissy is offline   Reply With Quote
Old 31st March 2006, 00:37   #2
goldy1064
Senior Member
 
Join Date: Jun 2005
Posts: 211
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.
goldy1064 is offline   Reply With Quote
Old 31st March 2006, 07:58   #3
sissy
Junior Member
 
Join Date: Mar 2006
Posts: 15
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 is offline   Reply With Quote
Old 31st March 2006, 08:16   #4
sissy
Junior Member
 
Join Date: Mar 2006
Posts: 15
After further reading i think i understand whats happening now.

Thank you.
sissy is offline   Reply With Quote
Old 31st March 2006, 08:18   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It might help if you attach the entire script. There isn't really much information here at this time.

-Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump