(view source code of listobj.cmd as plain text)
/* ListObj version 1.2 */
/* List all WPS object names */
/* (C) 1997-1999, Rob van der Woude */
/* Latest revision 1999/03/13 */
/* Initialize RexxUtil if necessary */
if RxFuncQuery( "SysLoadFuncs" ) <> 0 then do
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs
end
/* Initialize RexxLib if necessary and if available */
if RxFuncQuery( "RexxLibRegister" ) = 0 then do
rexxlib = 1
end
else do
rexxlib = 0
call RxFuncAdd "RexxLibRegister", "RexxLib", "RexxLibRegister"
call RexxLibRegister
if RxFuncQuery( "RexxLibRegister" ) = 0 then rexxlib = 1
end
/* Check for /P (pause) command line parameter */
parse upper arg "/"option .
if option = "?" then call Syntax
pause = 0
if left( option, 1 ) = "P" then pause = 1
/* Check text screen size and position cursor if necessary */
parse value SysTextScreenSize( ) with rows cols
parse value SysCurPos( ) with x y
if x = rows - 1 then do
x = rows - 2
call SysCurPos x, 0
end
/* Read a list of objects from OS2.INI */
call SysIni "USER", "PM_Workplace:Location", "ALL:", "object."
/* Sort the list if RexxLib is available */
if rexxlib = 1 then call ArraySort "object."
/* Display the formated list on screen */
call SysCls
say
say " "||object.0||" WPS Objects:"
say
j = 0
do i = 1 to object.0
say " "||object.i
j = j + 1
/* Pause at full screen */
if pause = 1 & j = rows - 6 then do
call AnyKey
j = 0
end
end
/* Pause at the end if there was anything */
/* left to display after the last pause */
if pause = 1 & j > 0 then call AnyKey "End"
EXIT
/* Pause at full screen */
AnyKey: procedure expose object.
say
say " Press any key . . ."
call SysCurState "OFF"
answer = translate( SysGetKey( "NOECHO" ) )
if translate( arg( 1 ) ) <> "END" then do
call SysCls
say
say " "||object.0||" WPS Objects:"
say
end
return answer
/* Display help */
Syntax: procedure
call SysCls
say
say " ListObj Version 1.2"
say " Display all WorkPlace Shell object names"
say
say " (C) 1997-1999, Rob van der Woude"
say
say
say " Usage: LISTOBJ [ /P | /? ]"
say
say " /P pause at full screen"
say " /? display this help screen"
exit
return
page last modified: 2024-04-16; loaded in 0.0061 seconds