Page 1 of 1

Passing parameters

Posted: Wed Oct 03, 2012 8:11 am
by daoa80
Question!

I have 2 screens (SCREEN1 and the TAGS SCREEN)

on the TAGS SCREEN I have the following:

void Test_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
.............................
}

and on the SCREEN1 I have the following:

void Button15_Click(System.Object sender, System.EventArgs e)
{
..............................
}


and the question is:

If I want to pass the value 0, 1, or 2, etc as a parameter from the SCREEN1 method to the TEST_ValueChange method on the TAGS SCREEN, which is the best way to do it?

can I do this:

void Button15_Click(System.Object sender, System.EventArgs e)
{
Test_ValueChange(xxxx, 0);
}

0,1 or 2 is the value and which will be the object sender?

Thanks for the help.

Re: Passing parameters

Posted: Wed Oct 03, 2012 8:55 am
by mark.monroe
The best way to create global script variables is to use a Script Module. Script Modules are accessible from anywhere in your application. You would create a class that contains the variables and functions that you want to access from anywhere in your application.

There is no way to pass variables between screens. The system handles the screen instances, therefore getting a handle to a specific screen is not easy.