![]() UJML Language Reference |
UJML applications can link to and run UJML partitions without stopping the current application.
Linking is the process of loading a compiled partition UJML file into memory and running it, without stopping the current application like running an application file does. See Application Files, Partition Files, Running Files.
Linked partitions are loaded into named areas of device memory. These named areas may then be explicitly unloaded and partitions in memory may also unload themselves.
There is no limit to the number of linked partitions you can load other than device memory. However, only one partition may use a named memory space at a given time. Attempting to link to a new partition using the same named memory space as an existing partition overwrites the existing partition with the new partition. Loading the same partition more than once into different memory named memory areas loads the partition separately each time, with a similar memory cost.
When a module (either an application or partition file) links to a partition, that partition may now link to other partitions. This nesting may occur to any depth, subject to device memory limitations.
Each 'parent' module has its own partition memory namespace, so two child partitions can each link to their own child partitions using the same names for the memory spaces and UJML will keep them separate.
Named members of a module, such as variables and functions, may be shared between a module and another partition which the module linked to. See Identifiers, Sharing. Sharing only works between a module that does the linking and the partition that was linked to, except that the linked to partition may link to other partitions which then have access to the same set of shared identifiers.
UJML provides a rich set of functions to link and unload partitions.
|
Function |
Description |
|
Loads and links to a new partition file using a name for the partition in memory. | |
|
Unlinks and unloads a named partition. | |
|
Unlinks and unloads the current partition if called from a partition file. If called from an application file it unloads the entire application. See Running Files. |
The following example shows how to link to the compiled partition file 'velocale.ujbc' using the partition name 'Locale'. The actual partition is loaded from different directories based on the language portion of the device locale string. It is part of the visualelements.ujml sample.
_link("Locale", _strcat(
_substring( _getStringProperty(&_PROPERTY_STRING_LOCALE;), 0, 2),
"/velocale.ujbc"));
The following example shows how to unlink the named partition linked above. It is part of the visualelements.ujml sample.
_unlink("Locale");|
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|