SysIni (Windows only)


Allows limited access to INI file variables. Variables are stored in the INI file under Application Names and their associated key names or keywords. You can use SysIni to share variables between applications or as a way of implementing GLOBALV in the Windows operating system. Be careful when changing application profile information.

Note: SysIni works on all types of data stored in an INI file (text, numeric, or binary).

When SysIni successfully sets or deletes key values, it returns "". For a successful query, it returns the value of the specified application keyword.

SysIni may return the string ERROR: when an error occurs. Possible error conditions include:



The name of the INI file with which you would like to work. The default is WIN.INI.

Note: If this argument does not contain a fully qualified file name, the Windows operating system searches for the file in the Windows directory. Therefore to work with a file outside of the Windows directory, specify the full path name of the file.


The application name or some other meaningful value with which you want to store keywords (some sort of data).


The name of a keyword to hold data.


The value to associate with the keyword of the specified application. This can be "DELETE:" or "ALL:".


The name of a Rexx stem variable collection in which to store the resultant information. SysIni sets Rexx variable stem.0 to the number of elements returned and stores these elements in stem.1 to stem.n.

Sysini has six modes. The modes and the syntax variations are as follows:


Sets a single key value.


Queries a single key value.


Deletes a single key.

           +-inifile-+      +-,"DELETE:"-+

Deletes an application and all associated keys.


Queries names of all keys associated with a certain application.


Queries the names of all applications.


/* Sample code segments */

/***  Save the user entered name under the key "NAME" of *****
****  the application "MYAPP".                           ****/
pull name .
call SysIni , "MYAPP", "NAME", name /* Save the value        */
say  SysIni(, "MYAPP", "NAME")      /* Query the value       */
call SysIni , "MYAPP"               /* Delete all MYAPP info */

/****  Type all WIN.INI file information to the screen  *****/
call SysIni "WIN.INI", "All:", "Apps."
if Result \= "ERROR:" then
do i = 1 to Apps.0
call SysIni "WIN.INI", Apps.i, "All:", "Keys"
if Result \= "ERROR:" then
do j=1 to Keys.0
val = SysIni("WIN.INI", Apps.i, Keys.j)
say left(Apps.i, 20) left(Keys.j, 20),
"Len=x"Left(d2x(length(val)),4) left(val, 20)