dicas
5 years agoOccasional Contributor
FindChild : Error: The object does not support this property or method
Hello, I tried to refactor my code with this below function, but i get the error in subject, when i try to access FindEx from Project.Variables.objstudioprocess When I set a breakpoint at this ...
- 5 years ago
To answer your question:
Project.Variables.variableName is not defined because there isn't a variable named variableName. There is a variable with the name that is the content of variableName.
So, let's say variableName is "myVariable". Then you would reference it as Project.Variables.myVariable or Project.Variables.VariableByName("myVariable").
Now, as to the other issue, this might be because you're using JavaScript and JavaScript can't assign values to indexed properties directly. So, you'll need to re-do that line like so.
function addNewProjectVariable(parentName, variableName, type, arrayNames, arrayValues) { if (!Project.Variables.VariableExists(variableName)) { let localVariable = Project.Variables.AddVariable(variableName, type); } // Variable is created / evaluated here already else { let localVariable = Project.Variables.VariableByName(variableName); } let propArray = arrayNames; let propValues = arrayValues; localVariable = Project.Variables.objstudioprocess.FindEx(propArray,propValues,depth=5,true,delay = 5000) Log.Message("systemView :"+Project.Variables.projectTreeView.Name) }
Alternatively, you may need to use the $set method to assign the variable value.