Forum Discussion

ridvan_filiz's avatar
ridvan_filiz
Occasional Contributor
10 years ago

starting scripts

in my project I have a Main script and from this script I start my test scripts:



function Main()

{

script1()

script2()

script3()

..

..

}



It works well. They will startet one by one. It means when one script ended then startet the next one.



But the same project is running in different customers and places with different number of scripts.  I want to use a external config file for every custumer and place which saved in local maschine.



I made a config file (Excel). When I read the config file (DDT["ExcelDriver]") and to execute them in a loop. They are not running. When I debug the script, the strings seem exactly as above.



I tried also read the file  and write script-names in an array  (Arr[1] == script1(), Arr[2] == script2(), Arr[3] == script3())



and then execute them



Arr[1]

Arr[2]

Arr[3]

But result is the same. They will not executed.

What is wrong?



Thank you



Ridvan Filiz

 

  • So you're building a string for the script you want to execute?



    You need to wrap it in a method that causes it to execute. I use "Eval()" for this. My setup is exactly as you describe. Function names and their parameters read in from an Excel sheet. Build a command string using the read in parts. Wrap the string inside an "Eval()" statement and off it goes ....
  • So you're building a string for the script you want to execute?



    You need to wrap it in a method that causes it to execute. I use "Eval()" for this. My setup is exactly as you describe. Function names and their parameters read in from an Excel sheet. Build a command string using the read in parts. Wrap the string inside an "Eval()" statement and off it goes ....