jeeejay
13 years agoContributor
Order of Project Variables
Hello,
I have several Project Variables defined in my TestComplete project. Towards the end of my script, I have this for loop:
for(i=0;i<Project["Variables"]["VariableCount"];i++)
{
variableName = Project["Variables"]["GetVariableName"](i);
// do something
}
I observed that order in which I get the variables is the same order in which the variables were added and not the way they are displayed in the Variables tab. That's understood but my problem is that I cannot drag variables to change their 'default' order nor can I insert a new variable at any particular point.
The only way I can achieve this is to delete all the variables below the one where I want to insert a new one and then re-create the deleted ones again and it is very inconvenient. Another workaround through code is to collect all the variables in an array and sort it - but that can be done only when I want them sorted alphabetically - and that's not the case every time.
It would be really nice to know if there is an easier way to change the order of the project variables currently.
- GJ
I have several Project Variables defined in my TestComplete project. Towards the end of my script, I have this for loop:
for(i=0;i<Project["Variables"]["VariableCount"];i++)
{
variableName = Project["Variables"]["GetVariableName"](i);
// do something
}
I observed that order in which I get the variables is the same order in which the variables were added and not the way they are displayed in the Variables tab. That's understood but my problem is that I cannot drag variables to change their 'default' order nor can I insert a new variable at any particular point.
The only way I can achieve this is to delete all the variables below the one where I want to insert a new one and then re-create the deleted ones again and it is very inconvenient. Another workaround through code is to collect all the variables in an array and sort it - but that can be done only when I want them sorted alphabetically - and that's not the case every time.
It would be really nice to know if there is an easier way to change the order of the project variables currently.
- GJ