home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d9xx
/
d950
/
bbdoors.lha
/
BBDoors
/
BBDoors65.lha
/
rexxDoors
/
Amiga_List.rexx
next >
Wrap
OS/2 REXX Batch file
|
1993-08-05
|
7KB
|
241 lines
/* Amiga List.rexx - updated for BBBBS.baud - 6 Februaury 1993 */
/* by Charles Johnston (Sysop) Crazy Train BBS 602-771-8971 */
/* Added ANSI color&detect-Menu redisplay for screen scrolling */
/* Pause and resume for listings that otherwise would scroll away. */
/* Clear screen code so program has it's own screen. */
/* Renamed program from 'sholist' to more descriptive 'Amiga List' */
/* ------------------------------------------------------------- */
/* Copyright 1989 Richard Lee Stockton and Gramma Software. */
/* This code is freely distributable as long as this copyright */
/* notice remains, unchanged, at the start of the code. Thank you. */
CR='0D'x
CALL TIME('R')
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
PARSE arg Username winnings . colorflag secs .
IF secs='' THEN secs=3600
/* Turns colors off unless colorflag=1*/
def=''
red=''
grn=''
yel=''
blu=''
mag=''
cyn=''
wht=''
IF colorflag=1 THEN /* let's see some color!*/
DO
def=''
red='
'
grn='
'
yel='
'
blu='
'
mag='
'
cyn='
'
wht='
'
END
/* Open the support library if it is not already open. */
if ~show('L',"rexxsupport.library") then do
addlib('rexxsupport.library',0,-30,0)
end
/* This is the menu and selection prompt function*/
Start:
SAY '0C'x /*Clear screen(formfeed)*/
SAY grn' A M I G A L I S T'def''||CR
SAY wht' ~~~~~~~~~ ~~~~~~~'def''||CR
SAY cyn' This is your chance to LIST what is going on inside the Amiga that is'CR
SAY ' running this BBS. You may combine letters to examine more than one area'CR
SAY ' such as: MDVPH would yield -> memory,devices,volumes,ports and handlers.'CR
SAY CR
SAY wht' =================================='grn' M E N U'wht' ================================'def''||CR
SAY CR
SAY yel' A=directories C=clip list D=devices F=open files H=handlers'||CR
SAY ' I=interrupts L=libraries M=memory P=ports R=resources'||CR
SAY ' S=semaphores T=ready_tasks V=volumes W=waiting_tasks X=REXX tasks'||CR
SAY CR
SAY wht LEFT('=',75,'=')||CR
SAY yel' Space Bar PAUSES listing - Backspace Key RESUMES'def''||CR
SAY grn' Press RETURN to EXIT to BBS'def''||CR
SAY CR
OPTIONS PROMPT def' '?' for Menu'yel' OR'def' Enter Letter(s): > '
DO FOREVER
PULL x
/* if no argument, then exit */
IF length(x)=0 THEN CALL OUT
CALL checkBBS()
/* if '?' clear screen call start (display menu) and return to prompt*/
IF (x=='?') THEN DO
CALL Start
END
/* Take each letter in the argument, one at a time */
DO i=1 TO length(x)
y=substr(x,i,1)
/* Select an appropriate title for this letter */
SELECT
WHEN y='A' THEN title = 'Assigned Directories [DOS list]'
WHEN y='C' THEN title = 'Clips [AREXX list]'
WHEN y='D' THEN title = 'Device Drivers'
WHEN y='F' THEN title = 'Open Files [local]'
WHEN y='H' THEN title = 'Handlers [DOS list]'
WHEN y='I' THEN title = 'Interrupts'
WHEN y='L' THEN title = 'Libraries'
WHEN y='M' THEN title = 'MemoryList Items'
WHEN y='P' THEN title = 'Ports'
WHEN y='R' THEN title = 'Resources'
WHEN y='S' THEN title = 'Semaphores'
WHEN y='T' THEN title = 'Ready Tasks'
WHEN y='V' THEN title = 'Volumes [DOS list]'
WHEN y='W' THEN title = 'Waiting Tasks'
WHEN y='X' THEN title = 'REXX Tasks'
OTHERWISE
DO /* Bad Letter in argument. Complain and die */
SAY '0C'x
CALL START
END
END
/* ARexx scans system lists. This is where the good stuff gets done. */
IF y='X' THEN CALL AStatus()
ELSE IF((y='C')|(y='F')) THEN list = show(y,,';')
ELSE list = showlist(y,,';')
/* everything below is just formatting and printing the list to the CLI */
/* based on the longest name in the list, and the number of list items. */
listlength=length(list) /* length in characters of the whole list */
longest=0
j=1
items=0
position=1
DO WHILE(position>0) /* how many total and how long is longest? */
position=pos(';',list,j) /* <-- returns 0 when the list runs out */
IF((position-j)>longest) THEN longest=position-j
IF(position>0) THEN j=position+1
items=items+1
END
IF((listlength+1-j)>longest) THEN longest=listlength+1-j /* last item */
columns = 77%(longest+2) /* we assume an 80 column display */
position=1
count=0
j=1
line = ""
IF(listlength==0) THEN items=0
SAY wht' -*-*-*-'cyn'' items title ''wht'-*-*-*-'def''||CR
IF(listlength==0) THEN ITERATE /* no list, go to next letter */
DO WHILE(position>0)
position=pos(';',list,j)
IF(position>0) THEN
DO
nextItem = ""
nextItem = left(substr(list,j,position-j),longest)
IF LENGTH(STRIP(nextItem))==0 THEN
nextItem = left("<blank>",longest)
line = line || nextItem || ' '
j = position + 1
END
ELSE line = line || left(substr(list,j),longest)
count = count + 1
IF(count=columns) THEN
DO
SAY yel'' line''||CR
count=0
line=""
END
END
IF(count>0) THEN SAY yel'' line''||CR /* Only print when the line is full */
SAY CR
END
END
EXIT
checkBBS:
IF ADDRESS()~='BAUD' THEN RETURN 0
IF TIME('e')>secs THEN SIGNAL OUT
dcd
IF RC=0 THEN EXIT
temp=secs-TIME('E')
IF temp<120 THEN SAY '*** Only' temp 'seconds left! ***'CR
RETURN 0
/* AStatus.rexx ARexx task list display by BaudMan */
AStatus:
RxsBase = findlib("rexxsyslib.library")
Call RxsOffsets()
TaskList = import(offset(RxsBase,RxsBase.rl_TaskList),4)
n=1
list=""
do j=1 TO 999 WHILE( import(TaskList,4) ~= NULL())
name=Import(Import(Offset(TaskList,56),4))
if name='' then do
name='String_'n
n=n+1
end
IF j=1 THEN list=name
ELSE list=list';'name
TaskList = import(TaskList,4)
END
RETURN;
OUT:
SAY '0C'X||CR
SAY CR
SAY Returning to BBS...||CR
SAY CR
CALL DELAY(75)
EXIT
/* Find a given library in the system - copied from Status.rexx */
findlib:
parse arg tofind
execbase = import('00000004'x,4)
nodebase = import(offset(execbase, 378), 4)
do while(import(nodebase,4) ~== NULL())
if import(import(offset(nodebase,10),4)) == tofind then
return nodebase
nodebase = import(nodebase,4)
end
say 'Could not find' tofind||CR
exit(20)
RxsOffsets:
RxsBase.rl_TaskList =168/* List */
RxsBase.rl_NumTask =182 /* WORD */
RxsBase.rl_LibList =184 /* List */
RxsBase.rl_NumLib =198 /* WORD */
RxsBase.rl_ClipList =200 /* List */
RxsBase.rl_NumClip =214 /* WORD */
RxsBase.rl_MsgList =216 /* List */
RxsBase.rl_NumMsg =230 /* WORD */
RETURN;
BREAK_C:
BREAK_E:
EXIT;
/* end of ShowList.rexx for BBBBS 6 February 1993 */