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:12 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
Odd read .INI behavior

Why does this work ONLY if the value in the .INI file is an integer versus a string???

Application.Macros(vbldTemporary).Add "FOO","[%READ_INI(C:\deploy.ini,Batch1,Server0)%]"

--------------------Starting Build: 'Deploy.bld'--------------------
Building project step 'Temp'...
Server0 = WWW6
Build successfully completed.

--------------------Starting Build: 'Deploy.bld'--------------------
Building project step 'Hostname Array'...
Building project step 'Show servername'...
The value of FOO is
Build successfully completed.

--------------------Starting Build: 'Deploy.bld'--------------------
Building project step 'Temp'...
Server0 = 150
Build successfully completed.

--------------------Starting Build: 'Deploy.bld'--------------------
Building project step 'Hostname Array'...
Building project step 'Show servername'...
The value of FOO is 150
Build successfully completed.

Is there some reason for this behavior?
Reply With Quote
  #2  
Old 05-28-2003, 05:25 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
The attached seems to work. It's not obvious to me what is different though.
Attached Files
File Type: zip delme.zip (520 Bytes, 1856 views)
Reply With Quote
  #3  
Old 05-28-2003, 05:34 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
Okay try this. I assigned my variables using VBS.
Attached Files
File Type: zip delme.zip (624 Bytes, 1938 views)
Reply With Quote
  #4  
Old 05-28-2003, 05:48 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Ok, the attached works for me including the VB script assignment version. Just using the Set Variable step is probably more straight forward though.
Attached Files
File Type: zip delme.zip (624 Bytes, 1899 views)
Reply With Quote
  #5  
Old 05-28-2003, 05:49 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
I wonder why it doesn't work for me.
What version are you using? I am using 5.
Reply With Quote
  #6  
Old 05-28-2003, 05:57 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
Version 5.

I added default values to the READ_INI macro parameter list.

I also removed the [] from the READ_INI strings, but that just removes [] from around the result string and doesn't otherwise affect the behaviour.
Reply With Quote
  #7  
Old 05-28-2003, 06:03 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Two things:

1) Remove the brackets [ ] from your Run Script step. Brackets are used in fields to denote script code. So, first any macros are expanded, then anything between brackets is evaluated as a script expression, and finally the whole string is run through the script engine. The 2nd phase is what's causing you trouble and is unnecessary.

2) There is no reference to a macro in the last step you added, my guess is you want %FOO% there.
Reply With Quote
  #8  
Old 05-28-2003, 06:05 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
How odd. I recreated just the read .ini steps in a new project, got it to work. Pasted them in my existing project and it works now, too.

Any way to do this...?

Let's say I have a counter (%COUNTER%) .. it counts 1 - 5.. Can I try do something like this?

%READ_INI(C:\deploy.ini,Batch1,Server%COUNTER%)%
Reply With Quote
  #9  
Old 05-28-2003, 06:08 PM
gdanko gdanko is online now
Registered User
 
Join Date: 05-27-2003
Posts: 18
I answered my own question. It works!
Reply With Quote
  #10  
Old 05-28-2003, 06:10 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
I was sorely puzzled by the [] and thought that the result would be as kinook described. However the result that I got when playing with it was that the [] were simply inserted into the string that was put in Foo.

However when Foo was expanded later the string was parsed as script and resulted in an error. The implication is that quoted text is not seen by the script engine.
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 12:01 AM.


Copyright © 1999-2023 Kinook Software, Inc.