home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sysset12.zip
/
setting.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-06-02
|
1KB
|
60 lines
/**/
call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
parse arg object setting loword hiword .
parse upper var loword loword
if object = '' | setting = '' then do
say
say 'Usage: SETTING object setting [loword] [hiword]'
return
end
sysset = '<SYSSET>'
object = '<'object'>'
inikey = setting
select
when loword = 'ON' then
num = 1
when loword = 'OFF' then
num = 0
otherwise
num = loword
end
if hiword \= '' then
num = 65536 * hiword + num
setup = 'SETOBJECT='object';SETPARAM='setting
call querysetting
if loword \= '' then do
call setsetting
call querysetting
end
return
querysetting:
call charout , 'Querying' setting 'state: '
if SysSetObjectData(sysset, setup';QUERYVAL='inikey) \= 0 then do
oldnum = strip(SysIni('USER', 'Sysset', inikey), , d2c(0))
call SysIni 'USER', 'Sysset', inikey, 'DELETE:'
oldhiword = oldnum % 65536
oldloword = oldnum // 65536
if oldhiword \= 0 then
call charout , oldhiword':'
select
when oldloword = 1 then
say '1 (ON)'
when oldloword = 0 then
say '0 (OFF)'
otherwise
say oldloword
end
end; else
say 'Failure'
return
setsetting:
call charout , 'Setting' setting 'to' num': '
if SysSetObjectData(sysset, setup';SETVAL='num) \= 0 then
say 'Success'
else
say 'Failure'
return