Forum Discussion
ray_mosley
13 years agoFrequent Contributor
I have already tried to explain what happened. I tried to replay the script using text that ended in an exclamation point character. It failed the match for variable _pos5 and failed by increasing the error count variable. It matched correctly when I changed the text that did not end in exclamation. It is a failure in aqString.Find, as described in the final sentence of the original post. In has nothing to do with the function below.
Here is the function and its description:
/*
Function qa_InitProjectVariable
initialize the value of a TestComplete Project variable
--preconditions
NA
---Parameters
NA
--postconditions
project variable has value
--returns
NA
--NOTE:
(1) It is the user's responsibility to use/save the returned string
*/
function qa_InitProjectVariable(vname,value)
{
if (!Project.Variables.VariableExists(vname))
{
//create the initial variable
Project.Variables.AddVariable(vname,"String"); //empty string:
}
//initialize existing variable
Project.Variables.VariableByName(vname) = value; //initialize
return;
}
//END OF function qa_InitProjectVariable
Here is the function and its description:
/*
Function qa_InitProjectVariable
initialize the value of a TestComplete Project variable
--preconditions
NA
---Parameters
NA
--postconditions
project variable has value
--returns
NA
--NOTE:
(1) It is the user's responsibility to use/save the returned string
*/
function qa_InitProjectVariable(vname,value)
{
if (!Project.Variables.VariableExists(vname))
{
//create the initial variable
Project.Variables.AddVariable(vname,"String"); //empty string:
}
//initialize existing variable
Project.Variables.VariableByName(vname) = value; //initialize
return;
}
//END OF function qa_InitProjectVariable