home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rxprior.zip
/
rxprior.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-01-18
|
3KB
|
78 lines
/*--------------------------------------------------------------------
Copyright IBM Corp., 1993,1994. All Rights Reserved.
OS/2 is a registered trademark of the IBM Corp.
While the information provided herein is believed to be accurate, IBM
does not warrant the information, and the information is provided "as
is".
---------------------------------------------------------------------*/
/*------------------------------------------------------------------
* rxprior.cmd : test the external functions in rxprior.dll
*------------------------------------------------------------------*/
"@echo off"
/*------------------------------------------------------------------
* load functions
*------------------------------------------------------------------*/
if RxFuncQuery("SysSetPriority") then
do
rc = RxFuncAdd("SysSetPriority","RxPrior","SysSetPriority")
rc = RxFuncAdd("SysGetPriority","RxPrior","SysGetPriority")
end
/*------------------------------------------------------------------
* print the current priority
*------------------------------------------------------------------*/
say "current priority:" SysGetPriority()
/*------------------------------------------------------------------
* change the priority a few times, and print info each time
*------------------------------------------------------------------*/
call Test "-1", "NOCHANGE" , "PROCESS"
call Test "-1", "REGULAR" , "THREAD"
call Test "-1", "TIMECRITICAL" , ""
call Test "-1", "FOREGROUNDSERVER" , "GARBAGE"
call Test "0"
call Test "0", "NOCHANGE"
call Test "1", "NOCHANGE"
call Test "2", "NOCHANGE"
call Test "3", "NOCHANGE"
call Test "0", "REGULAR"
exit
/*------------------------------------------------------------------
* run one test
*------------------------------------------------------------------*/
Test: procedure expose pid
delta = arg(1)
class = arg(2)
scope = arg(3)
/*---------------------------------------------------------------
* call with different # of parameters to test defaulting
*---------------------------------------------------------------*/
if (arg() = 1) then rc = SysSetPriority(delta)
else if (arg() = 2) then rc = SysSetPriority(delta,class)
else if (arg() = 3) then rc = SysSetPriority(delta,class,scope)
if (rc <> 0) then
say "rc =" rc "from SysSetPriority("delta","class","scope")"
/*---------------------------------------------------------------
* get the priority
*---------------------------------------------------------------*/
priority = SysGetPriority()
say "priority =" priority,
"from SysSetPriority("delta","class","scope")"
return