home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
bazy
/
intra2_17
/
rexx
/
demo2.irx
< prev
next >
Wrap
Text File
|
1994-02-19
|
1KB
|
57 lines
/* INTRA_demo2.irx by Bart Vanhaeren */
/* $VER: INTRA_demo2.irx 1.0 (6.9.1993) */
/* Example Arexx program for controlling INTRA by Bart Vanhaeren */
NL = '0a'x
OPTIONS RESULTS
IF POS('rexxsupport.library',SHOW('libs'))=0 THEN
nill=ADDLIB('rexxsupport.library',0,-30,0)
IF POS('INTRAREXX', SHOW('PORTS'))=0 THEN DO
SAY "*** Start INTRA first !!!"
EXIT(0)
END
ADDRESS (TRIM(SUBSTR(SHOW('PORTS'),POS('INTRAREXX',SHOW('PORTS')),12)))
SCREENTOFRONT
LOCKGUI NORENDER
REQUESTRESPONSE PROMPT "Calculate total of invoices ?!?"
IF RESULT=1 THEN DO
total=0
INVOICES
DO i=1 TO RESULT
READ i
GETDATA AMOUNT
PARSE VAR RESULT '"'RESULT'"' nill
total=total+RESULT
END
REQUESTNOTIFY PROMPT "Total amount: "||total
END
REQUESTSTRING PROMPT """Calculate total of which month ???""" DEFAULT "01-93"
IF RC~=1 THEN DO
info=RESULT
total=0
INVOICES
DO i=1 TO RESULT
READ i
GETDATA DATE AMOUNT
PARSE VAR RESULT '"'dat'"' '"'val'"' nill
IF RIGHT(dat,5) = info THEN total = total + val
END
IF total~=0 THEN REQUESTNOTIFY PROMPT "Total amount for 'XX-"info "=" total"'"
ELSE REQUESTNOTIFY PROMPT "Didn't find any amount for 'XX-"info"'"
END
REQUESTNOTIFY PROMPT "ARexx script is done ..."
UNLOCKGUI
EXIT(0)