home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
netdor3.zip
/
DISK_12
/
IMAGE11.ZIP
/
ADMTOOLS
/
TYPEINI.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-08-20
|
6KB
|
124 lines
/*****************************************************************************
* TYPEINI - Display an INI file *
* T. Rogers / T. Bridgman (CORE at WATSON) *
*****************************************************************************
* Licensed Materials-Property of IBM *
* 5604-472 (c) Copyright IBM Corporation, 1993 *
* All rights reserved. *
* US Government Users Restricted Rights - *
* Use, duplication or disclosure restricted *
* by GSA ADP Schedule Contract with IBM Corp. *
*****************************************************************************
* Change History: *
* Version 1.0 - 29 Sep 90 - tjr *
* Version 1.1 - 20 Dec 91 - teb *
* - bug fix: detect errors properly w/ latest RXUTILS *
* - Add ability to query select applications in the INI file *
* - Add on-line help *
*****************************************************************************/
trace 'O'
parse upper arg IniFile AppList '/' Opts
if IniFile = '' | IniFile = '?'
then signal Tell
say
say 'TYPEINI - Display INI file contents'
say
call LoadRxUtils
if rxFileExist(IniFile) | wordpos(IniFile, 'USER SYSTEM') <> 0
then if abbrev(rxOs2Ini(IniFile, '$RXALL', 'APPS.'), '$')
then do
say 'Error reading INI file' IniFile'.'
exit 2
end
else if Apps.0 = 0
then do
say 'INI file does not contain data.'
exit 2
end
else nop
else do
say 'INI file' IniFile 'does not exist.'
exit 2
end
parse value '0' with AsIs .
if Opts <> ''
then do
Opts = '/'Opts
AsIs = wordpos('/ASIS', Opts)
end
AppLimit = (AppList <> '')
say 'Contents of INI file' IniFile':'
do I = 1 to Apps.0
if AppLimit
then do
AP = wordpos(translate(Apps.I), AppList)
if AP = 0
then iterate I
AppList = delword(AppList, AP, 1)
end
if abbrev(rxOs2Ini(IniFile, Apps.I, '$RXALL', 'KEYS.'), '$')
then do
say 'Error reading' Apps.I 'from' IniFile'.'
iterate
end
say Apps.I':'
do J = 1 to Keys.0
Val = rxOs2Ini(IniFile, Apps.I, Keys.J)
if \AsIs
then Val = translate(Val,, '0007090A0D'x, 'FE'x)
say ' 'Keys.J':' Val
end
end
do while AppList <> ''
parse var AppList BadApp AppList
say BadApp': Not found.'
end
exit 0
LoadRxUtils: procedure
if \rxfuncadd('RXLOADFUNCS', 'RXUTILS', 'RXLOADFUNCS')
then do
signal on syntax name LoadRxUtils2
call rxLoadFuncs 'QUIET'
end
return 0
LoadRxUtils2:
signal off syntax /* Turn off temp error trap */
/* If you have an error trap in the program, use the following line inste
signal on syntax name syntax
*/
select
when rc = 40
then call rxLoadFuncs
when rc = 43
then do
say 'Error: RXUTILS.DLL not found.'
exit 2
end
otherwise do
say 'Error: Error' rc 'registering RXUTILS functions.'
exit 2
end
end
return 0
Tell:
say
say 'TYPEINI inifile [applist] [/ASIS]'
say
say 'Display the contents of the specified INI file.'
say
say 'inifile - The name of the INI file to display. USER and SYSTEM can'
say ' be specified for OS2.INI and OS2SYS.INI respectively.'
say 'applist - List of applications to display, separated by spaces.'
say ' If not specified, all applications will be displayed.'
say '/ASIS - By default, certain nonprintable characters (nulls, tabs,'
say ' carriage returns, and line feeds) will be replaced with a'
say ' "'||'FE'x||'". To see the raw data, specify /ASIS.'
exit 0