PDA

View Full Version : Unable to set macros in vbld_BuildStarting Project script?


jdavidi
02-28-2006, 09:23 AM
Good morning!

I have add plenty of macros with VBScript throughout my project steps, but I can't seem to get this to happen in the main Project script (vbld_BuildStarting event). When trying to use either of the add methods described here:

http://www.kinook.com/Forum/showthread.php?s=&threadid=1413&highlight=vbscript

I get:

Error firing vbld_BuildStarting event: Error in System (VBScript) script code at Line 497, Column 1 (Name redefined: 'vbldTemporary') for the Application.Macros(vbldMacroTemporary).Add "MacroName", "MacroValue" attempt

and

Error firing vbld_BuildStarting event: Error in Project (VBScript) script code at Line 1, Column 1 (Type mismatch: 'vbld_TempMacros') for the vbld_TempMacros().Add "MacroName", "MacroValue" method.

Here's my syntax (which works from a Run Script step):
Application.Macros(vbldTemporary).Add "CMD_SUBBUILDNUMBER", "00"
Am I missing something silly or are macros not meant to be added/set in the vbld_BuildStarting event?

Thanks!

-jdavidi

kinook
03-01-2006, 08:16 AM
That is supported and works here. Please ZIP and send or post:
1) The info from Help | About | Install Info
2) The .bld file used to build
3) The file listed at Tools | Application Options | File Locations | Global Macros

Thanks.

jdavidi
03-01-2006, 08:29 AM
Thanks for the reply; I noticed when I went to check my Help About screen that I'm on 6.0, and that 6.0a is available for download. I will get that version before sending anything.

jdavidi
03-01-2006, 03:04 PM
Hello again,

I still get the problem with 6.0a, although with the newer version it appears to be adding the temporary macro before stopping the build with the 'Error firing vbld_BuildStarting event' error. Here is my Install Info:

Visual Build Professional 6.0a
Registered to: Info Directions, Inc. (1-computer license)
Windows Version: 5.0.2195.4.0
Install path: C:\Program Files\VisBuildPro6
SftTree_IX86_U_50.dll version 5.02
unins000.exe version 51.42.0.0
VisBuildCmd.exe version 6.0.1.3
VisBuildPro.exe version 6.0.1.5
VisBuildBld.dll version 6.0.1.4
VisBuildCore.dll version 6.0.1.4
VisBuildDotNET.dll version 6.0.1.2
VisBuildExt.dll version 6.0.1.3
VisBuildLog.dll version 6.0.1.3
VisBuildMisc.dll version 6.0.1.3
VisBuildMS.dll version 6.0.1.3
VisBuildMS2.dll version 6.0.1.0
VisBuildNet.dll version 6.0.1.3
VisBuildSvr.dll version 6.0.1.4
VisBuildSvr.Interop.dll version 1.0.0.0

Attached please find a simple build script with which I can reproduce the problem. I'll attach the global macros file you requested with my next posting.

Thanks very much! --jdavidi

jdavidi
03-01-2006, 03:06 PM
Here's the global macros file (renamed as a txt file so I could attach it)

kinook
03-01-2006, 03:29 PM
Your project script code needs to be inside the vbld_BuildStarting event. Create the event by choosing Edit | Insert Event | vbld_BuildStarting on the menu, then move your code into that method.

jdavidi
03-01-2006, 03:33 PM
Ahhhh...that did the trick! Never noticed those menu items before. Thank you VERY much!

--jdavidi