Consultor Eletrônico



Kbase 17843: Using Global Variable Data Objects in Apptivity
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Using Global Variable Data Objects in Apptivity

Using Global Variables - Variable Data Objects

A variable data object provides a data buffer in which you can store
a value of a specified type. The value in this buffer is then
available globally within the given application.

You can create a variable data object by clicking on the data object
icon or by chosing the data object from the project pane in Apptivity
Developer. This example using a variable called MyName of type
String. You can also give it an initial value, e.g. "Joe".

You can bind the variable to controls, for example to a text field.
Use the Property sheet, the columns tab.

Access the value of the global variable as follows:
Object globVar = new Object();
try {
globVar = theApp().getGlobal("MyName").getValue(); }
catch (Exception e)
{System.out.println ("Exception! " + e);}

You can set the value of the global variable with setValue. This
example takes the value from a text field called "test".
try {
theApp().getGlobal("MyName").setValue(test.getValue());
}
catch (Exception e)
{System.out.println ("Exception! " + e);}


PES 04/13/98

Progress Software Technical Support Note # 17843