Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-31-2012, 10:43 AM
jraymer jraymer is online now
Registered User
 
Join Date: 07-31-2012
Posts: 3
Nested Macros

I can't believe I'm asking this, I've been using VBP for like 5 years now, but I'm having an issue with nested macros. I thought they would always be expanded. Here's the issue:

MACRO1=X
MACRO2=Y
MACRO3=%MACRO1%.%MACRO2%

At this point, MACRO3 will expand to "X.Y"

Re-set MACRO2=Z

I would expect MACRO3 to expand to "X.Z", instead I'm still seeing "X.Y".
I am really surprised that I have not run into this previously. What is the expected behavior in this situation? I was unable to find any documentation on this.
Reply With Quote
  #2  
Old 07-31-2012, 10:55 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
That works in my tests (see attached project).
Code:
7/31/2012 9:49:54 AM: -------------------- Starting Build: 'Macro3.bld' --------------------
7/31/2012 9:49:54 AM: Building project step 1 - Project steps...
7/31/2012 9:49:54 AM: Building project step 2 - Set 1...
Created Temporary macro 'MACRO1'
7/31/2012 9:49:54 AM: Building project step 3 - Set 2...
Created Temporary macro 'MACRO2'
7/31/2012 9:49:54 AM: Building project step 4 - Set 3...
Created Temporary macro 'MACRO3'
7/31/2012 9:49:54 AM: Building project step 5 - Show 3...
MACRO3 = X.Y
7/31/2012 9:49:54 AM: Building project step 6 - Update 2...
Updated Temporary macro 'MACRO2'
7/31/2012 9:49:54 AM: Building project step 7 - Show 3 again...
MACRO3 = X.Z
7/31/2012 9:49:54 AM: Build successfully completed (elapsed = 00:00:00).
Make sure MACRO3 is being assigned the unexpanded macro references rather than expanded macro values (for instance, if you're using the Set Macro action, check the Don't expand macros or script in value when setting option). If that doesn't help, please send the info requested at http://www.kinook.com/Forum/showthread.php?t=3044
Attached Files
File Type: bld Macro3.bld (1.5 KB, 1475 views)
Reply With Quote
  #3  
Old 07-31-2012, 11:07 AM
jraymer jraymer is online now
Registered User
 
Join Date: 07-31-2012
Posts: 3
Thanks for the quick reply. The "Don't expand macros..." may be the issue, but I need to go through my entire build script and check that box. I'm hoping I don't have other issues though, one of the macros used is passed in from the command line.
Reply With Quote
  #4  
Old 07-31-2012, 02:55 PM
jraymer jraymer is online now
Registered User
 
Join Date: 07-31-2012
Posts: 3
I updated all of the Set Macro statements in my build script and ran it. That did the trick.

Thanks again! Great response time!
Reply With Quote
Reply


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 Off
HTML code is Off



All times are GMT -5. The time now is 05:53 AM.


Copyright © 1999-2023 Kinook Software, Inc.