using c# methods that return values?

Class library usage, coding and language questions.
godzillajoe
Posts: 13
Joined: Wed Nov 20, 2013 4:16 pm

using c# methods that return values?

Post by godzillajoe » Wed Jan 08, 2014 7:27 pm

<deleted>
Last edited by godzillajoe on Tue Mar 11, 2014 6:46 pm, edited 2 times in total.

MarkusT

Re: using c# methods that return values?

Post by MarkusT » Thu Jan 09, 2014 1:44 pm

Hello godzillajoe,

You could create a variable (e.g. varTime) in your recording and use the following method to assign the value:
public void SetTime()
{
	varTime = System.DateTime.Now.ToShortTimeString();
}
Simply call this User Code method within your recording and use this variable for your actions (see below).
ActionsTable.PNG
ActionsTable.PNG (8.88 KiB) Viewed 1772 times
You could create a library with methods and reference it in your other projects to access it.
Please note that you would need to write User Code to handle return values since these values are ignored in the recording.

Please let me know if you need further information.

Regards,
Markus (T)

godzillajoe
Posts: 13
Joined: Wed Nov 20, 2013 4:16 pm

Re: using c# methods that return values?

Post by godzillajoe » Thu Jan 09, 2014 2:52 pm

Thanks Markus, I think this is enough to keep me moving forward.