I want to create a folders using project variable names.
I have one project suite variable
SSTEST1 string - c:\
I have created 3 project variables:
myvar1 string - test1\
myvar2 string - test2\
myvar3 string - test3\
When I run <font class="small">Code:</font><hr /><pre> call Utilities.CreateDir(ProjectSuite.Variables.GetVari ableDefaultValue(SSTEST1) & Project.Variables.GetVariableDefaultValue(myVar3)) </pre><hr />
the directory created is c:\test1
It should be c:\test3.
If I delete myvar1 and myvar2, then I get the correct output. Is only one variable per project allowed?
Don't know for certain but, since "GetVariableDefaultValue" takes a string as a parameter, you need to pass it a string. If you pass the var without quotes, it's going to try and grab the value of that var. In your case, it was probably returning an empty string (since myvar3 is undeclared without the Project.Variables prefix) which turned to a 0 index (since the method takes indices as well as astrings). Since you're passing the var name itself, you need to indicate that you are passing the name as string, hence the quotes.
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure