Forum Discussion
Hi blacy
If I understandyou well. You want to share a variable from script one to script to.
There are many posibilities.
The easyest one would be just creating a Project variable. (Double click into your project. Variable Tab. Create one variable...name it, choose type...)
From script 1 save the value into that variable.
Project.Variables.YOUR_VARIABLE = "whatever"
From Script 2
blahblah = Project.Variables.YOUR_VARIABLE
Another aproach would be to read from Script 2 the variable straight from the Script1. For that you have to import the Script1 from the Script2. Just add on top Script 2: 'USEUNIT Script1
Script1:
function function_return_value function_return_value = "some_value_in_script1" end function
Script2:
'USEUNIT Script1 sub subs_cannot_retur_values thisValue = Script1.function_return_value() Log.Message(thisValue) end sub
Functions can return values.
Subs cannot return values.
Note about project variables.
Persistent variables will remain after test run.
Temporally variables will be clean after test run.
Hope this example helps you
Regards,
Lage
Related Content
- 8 years ago
- 5 years ago
- 10 years ago
- 7 years ago
- 2 years ago
Recent Discussions
- 19 hours ago
- 5 days ago