home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
rexx
/
rdebug
/
tracesw.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-03-25
|
2KB
|
82 lines
/* TRACESW.REX 03-24-92 10:11 */
Arg s
/* test seperately
signal on error
signal on halt
signal on syntax
*/
parse value o 0 0 with t pc? lt?
Parse source sys .
if sys='OS/2' then sys='OS2'
else if sys='PCDOS' then sys='DOS'
else sys='CMS'
if lines('c:\ansi.sys')>0 then lt?=1
If (sys='DOS')+(sys='OS2')>0 Then pc?=1
If words(s)>2 Then Do
If pc? then do
Parse Var s . . file .
file=translate(file,' ','\.:')
n=words(file)
me=word(file,n-1)
ext=right(file,3); End
Else Parse Var s . . . ext . me .;end
Else Exit msg('tracesw',10,'Not enough parameters')
/*
call useage
*/
t= strip(t)
Exit t me pc? lt? ext sys
useage:
Address Command
Parse Value 1 1 1 1 With list.PROFILE list.BYE list.DUMPLOG list.HYPERTXT
'GLOBALV SELECT MY STACK TRACE'
If rc=0 Then Pull p t
If pc? Then Do
If lt? Then nop
Else Do
If list.me<>1 then do
/* call copytof */
/* COUNT_EXECUTION: */
address command 'GLOBALV SELECT USE STACK' me
parse value 0 date('o') with count . '/' mo '/' day
if rc=0 then pull . count
if count='' then count=0
address command 'GLOBALV SELECT USE SETPL' left(me,8) mo''day count+1
end
end
If p<>me Then t='o'
End
return
STATE: Procedure Expose pc?
Arg f
If pc? Then Do
If dosdir(f)='' Then rc=28
Else rc=0;end
Else 'state' f
Return rc
/* code museum
tracesw.kex/rex
if lt? then do
If list.me<>1 & state('c:\'me'.'ext)=28
/*Then ' COPY a:'me'.'ext 'c:\ >nul';end*/
Then 'BCOPY a:'me'.'ext 'c:\ >nul';end
call copytof:
If state('f:\'me'.'ext)=28 Then Do
If ext='REX' Then Do
speca='c:\mya\'me'.'ext
specc='c:\myc\'me'.'ext; End
Else Do
speca='c:\mya\ak\'me'.'ext
specc='c:\myc\ck\'me'.'ext; End
/* If state(speca)=0 Then 'bcopy' speca 'f:\ >nul'
If state(specc)=0 Then 'bcopy' speca 'f:\ >nul'
Else 'BCOPY' specc 'f:\ >nul' */
If state(speca)=0 Then ' copy' speca 'f:\ >nul'
/*Else ' COPY' specc 'f:\ >nul'*/
else If state(specc)=0 Then ' copy' specc 'f:\ >nul'
End
return
*/