Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-19-2008, 09:36 AM
Rogier Rogier is online now
Registered User
 
Join Date: 09-09-2004
Location: the Netherlands
Posts: 40
How to use non-global macros from other projects?

I would like to have one "init_passwords.bld" project which sets some password macros, and then run that bld from several other projects. However I don't want to set them as global macros or environment variables. This way I can store all passwords at one secure place (the init_passwords.bld would be on an encrypted drive).

But when I use temporary macros, the calling project doesn't have access to them, and when I use project macros, it asks whether I want to save the bld every time.

So, I want:
- myproject.bld to run (or call, or include, or whatever) some init.bld
- init.bld to set some password macros, but not as global macros or env vars (at least not env vars that survive beyond myproject.bld's execution)
- use the macros set by init.bld in myproject.bld

I guess if projects could include other projects, rather than just running them in a separate session, that would solve my problem, and it'd allow for quite some other handy tricks as well.

Is something like this possible?
Reply With Quote
  #2  
Old 02-19-2008, 09:59 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,750
Create a .macros file containing the password macros, either by manually creating a file in this format:

Code:
<?xml version='1.0' encoding='utf-8'?>
<macros version='6'>
  <macro name='PWD1'>
    <value>macro value here</value>
  </macro>
  <macro name='PWD2'>
    <value>macro value here</value>
  </macro>
</macros>
or by adding project macros to a new .bld file, and adding+building a Run Script step with code like this to create the macros file:

Project.Macros.Save "c:\path\to\passwordfile.macros"

Then, in myproject.bld, use a Run Script step with code like this to merge the password macros file into temporary macros:

Application.Macros(vbldMacroTemporary).Load "c:\path\to\passwordfile.macros"

http://www.visualbuild.com/Manual/macroscollection.htm
http://www.visualbuild.com/Manual/runscript.htm
Reply With Quote
  #3  
Old 02-19-2008, 10:32 AM
Rogier Rogier is online now
Registered User
 
Join Date: 09-09-2004
Location: the Netherlands
Posts: 40
Thumbs up

Thanks a lot, works like a charm!!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 12:11 AM.


Copyright 1999-2019 Kinook Software, Inc.