|
#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
The attached seems to work. It's not obvious to me what is different though.
|
#3
|
|||
|
|||
Okay try this. I assigned my variables using VBS.
|
#4
|
|||
|
|||
Ok, the attached works for me including the VB script assignment version. Just using the Set Variable step is probably more straight forward though.
|
#5
|
|||
|
|||
I wonder why it doesn't work for me.
What version are you using? I am using 5. |
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
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. |
#8
|
|||
|
|||
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%)% |
#9
|
|||
|
|||
I answered my own question. It works!
|
#10
|
|||
|
|||
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. |
|
|