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 05-28-2003, 05:04 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
Build only if macro or expression

I have an .ini file that determines how my software deployment is run. One of the parameters in the .ini file is NewMachineConfig.

-- Begin Snippet --
[Global]
NewMachineConfig = 0
-- End Snippet --

I have a Log Message that queries the value of this entry. It looks like this:

New machine.config = %READ_INI(C:\deploy.ini,Global,NewMachineConfig)%

When I run that Log Message I get this output:

--------------------Starting Build: 'Deploy.bld'--------------------
Building project step 'Temp'...
New machine.config = 0
Build successfully completed.

So I am able to read this value properly. I have a SourceSafe step that grabs the machine.config file from SourceSafe, but I only want this file to be copied down if the deployment requires it. So in my SourceSafe step I check the "Build only if macro expression" box and put this in place:
%READ_INI(C:\deploy.ini,Global,NewMachineConfig)%
is equal to 1

My .ini file will use a binary for yes|no. VBP grabs this file from SourceSafe regardless of the state of that macro. I've tried it with and without surrounding [ ]'s.

What have I done wrong?
Reply With Quote
  #2  
Old 05-29-2003, 01:41 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
Seems like my upgrade from 4.0 to 5.0 messed me up. After doing a clean install of 5.0 things started working properly.
Reply With Quote
  #3  
Old 05-29-2003, 03:52 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
In general use the Is True test rather than testing for equality for a true/false type test.

A VBScript or JScript true == -1. You happened to use 1 for the same semantic value (no harm in that, some of the best languages use 1 for true internally). Generally any non-zero value can be treated as true and only 0 is treated as false.

Your test becomes:

%READ_INI(C:\deploy.ini,Global,NewMachineConfig)%
is true

Note that the [] are not required because this is simply a Macro expansion (albeit a magical one as far as I can see). In this case they don't do any harm either because [0] == 0 && [1] == 1.
Reply With Quote
  #4  
Old 05-29-2003, 04:00 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
This all seems to have something to do with my upgrade versus straight install. Version 5 seems to have it fixed.
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 10:19 AM.


Copyright © 1999-2023 Kinook Software, Inc.