xcall MIAMEX, MX_REGISTRY, opcode, <params depending on opcode>
(Windows only) MX_REGISTRY provides a range of Registry operations. The symbols and values for opcode are shown in the following table. Parameters, which are dependent on the function being called, are listed and discussed in the topics covering the various functions. See also MX_GETREG (simplified retrieve with ATE support).
Symbol |
Value |
Function |
REGOP_OPEN |
1 |
|
REGOP_CREATE |
2 |
|
REGOP_SET |
3 |
|
REGOP_READ |
4 |
|
REGOP_ENUMKEYS |
5 |
|
REGOP_ENUMVALS |
6 |
|
REGOP_CLOSE |
7 |
|
REGOP_DELKEY |
8 |
|
REGOP_DELVALUE |
9 |
|
REGOP_DELIMS |
64 |
|
Definition file: ashell.def |
Comments
MX_REGISTRY does not recognize ATE. If executed in a non-Windows environment (whether ATE or not), it will be essentially a null operation. If executed in the ATSD environment, it will return information from the server registry, not the client. If you want to retrieve registry information from the ATE client, either use MX_GETREG for simple retrieval, or package your MX_REGISTRY operations in an SBX which can be executed on the client side via AG_XFUNCS or MX_AGWRAPPER.
Although direct access to the Registry is not available for applications running A-Shell/UNIX, Steve Evans of Caliq has developed a pair of routines (INIX.SBX and SYSREG.SBX) which allow information to be saved using a similar model but which work on all platforms. See the routines in the SOSLIB for details.
History
2009 September, A-Shell 5.1.1159: MX_REGISTRY now supports returning data into dynamic variables, such that they expand as needed. Previously, the output data was being truncated to the current size of the variable, or 0 for uninitialized.
2005 March, A-Shell 4.9.925: Routine was enhanced to provide an option for more friendly delimiters when retrieving or setting REG_MULTI_SZ values. This value type is used for lists of names, like bin names or paper size names, and consists of strings separated by a null byte, with the last string terminated by two null bytes. This format makes sense in C, but in BASIC, it is difficult to deal with the embedded nulls. The new option replaces the null terminators, except for the very last one, with chr(128) characters. For the set opcode, you may optionally use these same chr(128) characters to build your value string. The option is activated by adding 64 (REGOP_DELIMS) to the opcode. This applies to opcodes 4 and 6.
See the sample program REGPTR.BP for a working example.