Passing parameters

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
daoa80
Posts: 44
Joined: Fri Aug 10, 2012 8:50 am

Passing parameters

Post 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.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Passing parameters

Post 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.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply