Global Variable Support
Global variables are created by the exit, unlike the variables described in the previous section, which are created by the exit points.
In Windows, “global” variables are maintained within the registry in the Optim™ section of the Software section of the proper hive. In UNIX, the emulated registry is used. The global variables are saved encrypted, so you can keep sensitive data in them, such as passwords.
Since the data is maintained in the registry, it can be deleted or modified by anyone who has the authority to update the registry. Thus, it is possible the data may not be there on subsequent calls, even though it is encrypted. (In UNIX, the entire emulated registry is a file that can be deleted.)
Since the data is maintained in the registry, there is no protection against it being simultaneously updated by multiple threads or even multiple processes, unless the registry is designed to prevent this and will not be corrupted (last in overlays what is there).
The specified global variable name may only consist of alphanumeric (ASCII) characters and the following characters: the underscore (_), minus sign (-), pound sign (#), and at sign (@. Spaces are not allowed. This is done to allow retrieval of the variable from different locales. (These restrictions are even enforced in Unicode-based exits that do not use locales.)
The contents of the variable, however, are up to you, but you should make sure the variable can be used between locales if Optim runs under different locales (for instance, if the remote action process runs under the same locale as the client, we translate between platforms, so it depends on the locale of the clients that connect to the server).
If the name is invalid and you requested that all errors be returned, OPMEX_ERR_INVALID is returned; otherwise, an exception occurs.