TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Doug Glenn
from: David Johnson
date: 1994-09-12 05:50:44
subject: Ini Structure And Manipul

DG>     I've done a search on all the info that I have that came with
DG>     Watcom 9.5, and 10, and cannot locate it. Is it in the Redbooks?
DG> 

in the rexx program reference. i.e.

 Function: SysIni 

    Syntax - Mode 1: Setting single key value. 

              result = SysIni([inifile], app, key, val) 

    Syntax - Mode 2: Querying single key value. 

              result = SysIni([inifile], app, key) 

    Syntax - Mode 3: Deleting a single key. 

              result = SysIni([inifile], app, key, 'DELETE:') 

    Syntax - Mode 4: Deleting an application and all associated keys. 

              result = SysIni([inifile], app, ['DELETE:']) 

    Syntax - Mode 5: Querying names of all keys associated with a
certain application. 

              result = SysIni([inifile], app, 'ALL:', 'stem') 

    Syntax - Mode 6: Querying names of all applications. 

              result = SysIni([inifile], 'ALL:', 'stem') 

    result    For successful setting invocations, result will equal
''. For successful querying invocations, result will                be
given the value of the specified application keyword.  For successful
deleting invocations, result                will equal ''. 

              The error string 'ERROR:' may be returned if an error
occurs: 

              Possible error conditions: 

       o An attempt was made to query or delete an application/key
pair which does not exist. 

       o An error occurred opening the specified INI file. You may
have specified the current user or system INI file           using a
relative filespec. Make sure to use the full filespec, specifying
drive, path, and file name. 

    inifile   The name of the INI file which you would like to work
with.  This parameter should be a file                specification, or
one of the following: 

       'USER'    The user INI file (usually C:\OS2\OS2.INI).  This is
the default. 

       'SYSTEM' The system INI file (usually C:\OS2\OS2SYS.INI). 

       'BOTH'    For querying invocations, both the user and system
INI files will be searched. For setting                   invocations,
the user INI file will be written to. 

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

    key       The name of a keyword which is used to hold data. 

    val       The value to associate with the keyword of the specified
application. 

    stem      The name of the stem variable to store the resultant
information in.  STEM.0 will be set equal to the                number
of elements. 

 Purpose:  This function allows limited editing of INI file variables.
Variables are stored in the INI file under             Application Names
and their associated Key Names or keywords.  SysIni can be used to
share variables             between applications or as a way of
implementing GLOBALV in the OS/2 operating system. 

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

           /* 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 */            
exit                         /****  Type all OS2.INI file information to
the screen  *****/            call rxfuncadd sysloadfuncs, rexxutil,
sysloadfuncs            call sysloadfuncs               call SysIni
'USER', 'All:', 'Apps.'               if Result \= 'ERROR:' then         
       do i = 1 to Apps.0                   call SysIni 'USER', Apps.i,
'All:', 'Keys'                   if Result \= 'ERROR:' then              
     do j=1 to Keys.0                      val = SysIni('USER', Apps.i,
Keys.j)                      say left(Apps.i, 20) left(Keys.j, 20),      
                     'Len=x'''Left(d2x(length(val)),4) left(val, 20)    
               end                 end

 * KWQ/2 1.2g NR * Why look thru Windows? Open the door to the future: OS/2

--- QScan v1.067b


* Origin: Programmer's Guild BBS, Hamilton, Ont. (1:244/317)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 244/317 300 99 12/12 270/101 396/1 3615/50 229/2 12/2442
@PATH: 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.