>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User

Form Locales

A key point about forms is that they may be created and run in any locale, in fact this would typically be the case. Forms can be created as a class, then instantiated as an object when they are to be run. For a description, see the labs on Locales and Object Oriented Programming.

When a form is created, the current locale is recorded as the form locale. This locale is part of the event information, and allows an event to be handled by the form handler in the locale.

For example, this means a form can be run in its own locale, without conflicting in any way with definitions in other locales. You can design a form in the base locale, and run it without change in another locale.

To experiment with this, switch to the J session, and clear out existing definitions in the base locale:

   clear''

Check there are no definitions in the base locale:

   names''

Load the form into a locale myname:

   'myname' load 'system\examples\demo\name.ijs'

The form is shown. Change the name and click OK to close the form and update the global, NAME. Note that there are still no definitions in the base locale:

   names''

However, there are definitions in the myname locale:

   names_myname_''
EDITNAME               NAME                   
editname               editname_Cancel_button 
editname_OK_button     wdq

Read the value of the name defined:

   NAME_myname_
Squirrel Nutkin

>>  <<  Ndx  Usr  Pri  Phr  Dic  Rel  Voc  !:  wd  Help  User