home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxini.zip / README next >
Text File  |  1993-10-15  |  3KB  |  101 lines

  1.     R E X X I N I
  2.  
  3.     Rexx API's for manipulation of Text Based INI Files (used by WINOS2)
  4.  
  5.     Written: Steven Elliott - CompuServe 100032,1454
  6.  
  7.     Useful for manipulating and fixing text ini files used by DOS and windows programs
  8.  
  9.     FREEWARE
  10.  
  11.     Functions Supported
  12.  
  13.     IniLoadFuncs    Load this library
  14.     IniDropFuncs    Unload this library
  15.  
  16.     IniLoad(section, file)
  17.     will load the entire section into a stem variable of the section
  18.     name, with the shoots being the field = value pairs
  19.  
  20.     IniEnum(stem, where)
  21.     returns array of fields. stem.0 = num entries
  22.  
  23.     str = IniGet(field, where)
  24.     returns string value of field
  25.     bool = IniBool(field, where)
  26.     returns '0' for False and '1' for True
  27.         supports field being 0/1 or True/False or Yes/No
  28.  
  29.     IniDel(field, where)
  30.     deletes the specified field from the section
  31.  
  32.     IniSet(field, value, where)
  33.     sets filed to the value value
  34.  
  35.     IniEnumSections(stem, file)
  36.     returns array of section names in stem.  stem.0 = number of entries
  37.  
  38.     handle = IniOpen(section, file)
  39.     returns a handle to use for other functions (in place of 'where')
  40.     handle <= 0 is error
  41.  
  42.     IniClose(handle)
  43.     close the specified inifile section
  44.     IniSave(handle)
  45.     save any changes made to the inifile section
  46.     IniCopy(handle, section, file)
  47.     copy all fields in the 'handle' section to the specified 'section'
  48.     in the specified 'file'
  49.  
  50.     where is either 'handle' or 'section, file'
  51.     When multiple entries are changed in the same section it is
  52.     preferable and faster to use the handle version
  53.  
  54.  
  55. eg:
  56.  
  57. WIN.INI
  58.  
  59. [Desktop]
  60. Pattern=(None)
  61. Wallpaper=(None)
  62. GridGranularity=0
  63. IconSpacing=100
  64.  
  65.  
  66. call rxfuncadd 'IniLoadFuncs', 'REXXINI', 'IniLoadFuncs'
  67. call IniLoadFuncs
  68.  
  69. wfile = 'C:\OS2\MDOS\WINOS2\WIN.INI'
  70.  
  71. say "The current Windows Wallpaper is" IniGet('Wallpaper', 'Desktop', wFile)
  72.  
  73. say "The [Desktop] section contains the following fields"
  74. handle = IniOpen('Desktop', wFile)
  75. call IniEnum 'Desktop', handle
  76. do i = 1 to Desktop.0
  77.   say Desktop.i '=' IniGet(Desktop.i, handle)
  78. end
  79.  
  80. say "Changing Granularity and Spacing"
  81. call IniSet 'GridGranularity', 10, handle
  82. call IniSet 'IconSpacing', 50, handle
  83.  
  84. call IniSave handle
  85.  
  86. call IniClose handle
  87.  
  88. say ""
  89. say "The [Desktop] section now contains the following:"
  90.  
  91. call IniLoad 'Desktop', wFile
  92.  
  93. say "Pattern = " Desktop.Pattern
  94. say "Wallpaper = " Desktop.Wallpaper
  95. say "GridGranularity =" Desktop.GridGranularity
  96. say "IconSpacing =" Desktop.IconSpacing
  97.  
  98. call IniDropFuncs
  99. say "That's all folks!"
  100.  
  101.