Page 1 of 1

Make variable in UserCode file available in recoding module

Posted: Mon Sep 30, 2013 10:42 pm
by caleb
Hi

I have come across this problem several times and it's not too difficult to work around but I wondered if there is a way to have a variable (say a string value) that a UserCode method has set and make it available in the recoding module so that I can send that as an argument to another user code method while keeping the obvious flow of the program within the recording module.

for example in my recording module I want something like this
UserCode FindX()
UserCode UseXToSetY(X, Y)

however this is not as simple as the example makes it appear because the UseXToSetY function is a commonly used function in the parent class of the user module that includes FindX.

hopefully that actually makes sense to someone, I'm not looking for a work around I can already do that I just wondered if there is a simple solution that I am missing.

Thanks

Caleb

Re: Make variable in UserCode file available in recoding module

Posted: Tue Oct 01, 2013 3:33 pm
by Support Team
Hello,

You could create a recording variable (X and Y) in your recording module and set the value of it in a User Code method. In another User Code method, you could pass the value of your variable as an argument to your method.
public void FindX()
{
	X = "2";     	
}

public void UseXtoSetY(string myX, string myY)
{
	Y = myX;       	
}
Please let me know if this is what you want.

Regards,
Markus (T)