home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sysset12.zip / printscr.cmd < prev    next >
OS/2 REXX Batch file  |  2000-06-02  |  1KB  |  53 lines

  1. /**/
  2. call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  3. call SysLoadFuncs
  4. sysset = '<SYSSET>'
  5. object = '<WP_SYSTEM>'
  6. setting = 'PrintScreen'
  7. inikey = 'PrtScr'
  8. setup = 'SETOBJECT='object';SETPARAM='setting
  9. arg state .
  10. select
  11.   when state = 'ON' then
  12.     num = 1
  13.   when state = 'OFF' then
  14.     num = 0
  15.   when state = '?' then do
  16.     say
  17.     say 'Usage: PRINTSCR [ON | OFF]'
  18.     return
  19.   end
  20.   otherwise
  21. end
  22. call queryprintscreen
  23. if state \= '' then do
  24.   call setprintscreen
  25.   call queryprintscreen
  26. end
  27. return
  28.  
  29. queryprintscreen:
  30.   call charout , 'Querying PrintScreen state: '
  31.   if SysSetObjectData(sysset, setup';QUERYVAL='inikey) \= 0 then do
  32.     oldnum = strip(SysIni('USER', 'Sysset', inikey), , d2c(0))
  33.     call SysIni 'USER', 'Sysset', inikey, 'DELETE:'
  34.     select
  35.       when oldnum = '1' then
  36.         say 'ON'
  37.       when oldnum = '0' then
  38.         say 'OFF'
  39.       otherwise
  40.         say oldnum
  41.     end
  42.   end; else
  43.     say 'Failure'
  44.   return
  45.  
  46. setprintscreen:
  47.   call charout , 'Setting PrintScreen to' state': '
  48.   if SysSetObjectData(sysset, setup';SETVAL='num) \= 0 then
  49.     say 'Success'
  50.   else
  51.     say 'Failure'
  52.   return
  53.