Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

AmZone

A m Z o n e


Sharing variables defined in package specification of a library, between Multiple Forms (Forms 6i)...

Variables defined in a database package specification are accessible to all forms being called in that session. So to say, the values set for these variables in one form can be accessed in another form. Sharable Packages can be created in the front-end also as part of a library. Is it possible to share values assigned to a front-end package specification variable in a library between multiple forms? This solution could be a break through in the way we share data between forms, without the help of database.

E.g.: Library 'libstd' is attached to both form A and form B. Package 'string_operation' is part of the library. Variable p_substr is a specification variable in this package. Form A assigns the string "bingo" to this variable. Form B is then called from form A. Is it possible for form B to refer to the value assigned to the variable p_substr? Now if form B assigns some value to the same variable, can Form A refer it?



Use the data mode option share_library_data while invoking another form. 1. This option will work in the same session only. 2. Works with call_form, open_form (session level) and new_form (slightly buggy, first call between the two forms doesn't share the library data).


E.g.: fp_string_operations.p_substr := :block2.value1; --assigning value to a library package spec variable. call_form('share_data_b',hide,no_replace,no_query_only,share_library_data);

Both package specification variables and global variables have the same functionality, but the later encounters more maintenance over head. Some common differences:

  1. Global variables cannot be directly referred in library. There is a work around to do this, but indirectly.
  2. Maintenance problem with global variables, difficult to maintain over a large application.
  3. Package specificaiton variables in a library can be monitored and maintained.
  4. Global variable can be erased from memory. Package specificaiton variables are always available.
  5. Global variables are of char datatype always. Package specification variables can vary in data type and can be defined with reference to the database.
  6. Global variables have a max length of 255 characters, sorry can't exceed this.

  7. Press the Back button of you Browser to go to previous page
    Home