home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d581
/
stopwatch.lha
/
StopWatch
/
StopWatch.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-01-04
|
7KB
|
257 lines
/****************************************/
/* StopWatch.rexx */
/* ARexx-demo for StopWatch V3.0 */
/* Copyright by Christian Danner 061291 */
/****************************************/
/* Note: The colorfont stopwatch (see StopWatch.pic), an */
/* outline font derived from the helvetica 24 font, */
/* is not included in this package for copyright */
/* reasons. So use a font editor to generate your */
/* own time display font.
/* See the "StopWatch" manual for details on this. */
TRACE OFF
ADDRESS COMMAND /* run StopWatch */
STARTED = 0
/*
"RunBack ColorText" /* run ColorText for color fonts */
*/
RC = SHOW( PORTS, "RexxStopWatch")
IF RC = 0 THEN
DO
"Run StopWatch -d10 -b -o3 -w704 -h450 -k66afff000d00444dd00d000b -nstopwatch -z27 -x485 -y345 -i250 -j345 -t485 -u345"
DO FOR 10
"WaitForPort RexxStopWatch"
END
IF RC ~= 0 THEN
DO
SAY "Starting StopWatch failed !!"
EXIT 20
END
ELSE
STARTED = 1
END
ADDRESS "RexxStopWatch" /* selection of the REXX-port */
OPTIONS RESULTS
LOCKEXIT /* prevent from exiting program */
LOCKTIMER /* lock timer */
LAPS 3 /* modify parameters */
VIACYCL 708 /* coarse tuning */
CORRECT "-525" /* fine tuning */
CYCLSEC 1000 /* resolution 1/1000 sec. */
REFRACT 500 /* refraction 500 * resolution */
TIMEFONT STOPWATCH 27 /* select time display font */
BEEP OFF /* display beep off */
SCREENADDRESS /* get address of display screen */
IF RC = 0 THEN
SAY "SCREEN-ADR : "RESULT
ELSE
SAY "ERROR : "RC
BOXO 65 45 594 50 2 /* screen box / text header */
BOXO 55 35 594 50 1
BOXO 60 40 584 40 0
BOXT 60 40 584 40 7
TEXTFONT SAPPHIRE 19
TEXTCS 352 50 1 2 "Silverstone Formula 1 Grand Prix 1991"
BOXO 65 395 594 35 2 /* screen box / text footer */
BOXO 55 385 594 35 3
BOXO 60 388 584 29 0
BOXT 60 388 584 29 2
TEXTFONT DIAMOND 20
TEXTC 355 395 2 "-1" "StopWatch V3.0 by Christian Danner"
TEXTC 352 393 1 "-1" "StopWatch V3.0 by Christian Danner"
TEXTFONT HELVETICA 18 /* title of result list */
TEXTC 355 115 2 "-1" "F I N A L R E S U L T S"
TEXTC 353 113 3 "-1" "F I N A L R E S U L T S"
TEXTC 351 111 5 "-1" "F I N A L R E S U L T S"
BOXO 65 145 594 175 2 /* box for result list */
BOXO 55 135 594 175 1
BOXO 60 140 584 165 0
BOXT 60 140 584 165 4
TEXTFONT HELVETICA 24 /* result list */
SHADOW "-1 -1 0 -1 1 -1 -1 0 1 0 -1 1 0 1 1 1 4 8"
TEXTRS 80 150 5 2 "1"
TEXTRS 140 150 5 2 "Ayrton Senna"
TEXTRS 80 180 5 2 "2"
TEXTRS 140 180 5 2 "Martin Brundle"
TEXTRS 80 210 5 2 "3"
TEXTRS 140 210 5 2 "Nelson Piquet"
TEXTRS 80 240 5 2 "4"
TEXTRS 140 240 5 2 "Alain Prost"
TEXTRS 80 270 5 2 "5"
TEXTRS 140 270 5 2 "Gerhard Berger"
TEXTCS 390 150 1 2 BRA
TEXTCS 390 180 3 2 GBR
TEXTCS 390 210 5 2 FRA
TEXTCS 390 240 6 2 FRA
TEXTCS 390 270 7 2 AUT
SHADOW "2 4"
TEXTLS 620 150 3 2 "2:35:18.037"
TEXTRS 500 180 3 2 "+"
TEXTLS 620 180 3 2 "2.381"
TEXTRS 500 210 3 2 "+"
TEXTLS 620 210 3 2 "13.924"
TEXTRS 500 240 3 2 "+"
TEXTLS 620 240 3 2 "46.182"
TEXTRS 500 270 3 2 "+"
TEXTLS 620 270 3 2 "46.712"
BOXO 60 100 61 31 2 /* example drawings */
BOXO 60 100 40 20 3
BOXO 60 100 20 10 5
BOXO 583 100 30 15 7
DRAW 1 584 101
DRAW 1 588 101
DRAW 1 592 101
DRAW 1 596 101
DRAW 1 586 103
DRAW 1 590 103
DRAW 1 584 105
DRAW 1 588 105
DRAW 1 586 107
DRAW 1 584 109
ELLIPSE 613 115 30 15 3
ELLIPSE 613 115 25 15 1
ELLIPSE 613 115 20 15 3
ELLIPSE 613 115 15 15 1
ELLIPSE 613 115 10 15 3
ELLIPSE 613 115 5 15 1
DRAW 7 150 104 220 115 150 126 150 104
FILL 151 115 7
DRAW 7 554 104 484 115 554 126 554 104
FILL 553 115 7
SHADOW "-1 -1 0 -1 1 -1 -1 0 1 0 -1 1 0 1 1 1"
TIMECOLOR 5 0 /* select color of time font */
RESET /* reset of the timer */
NEXTLAP /* get next additive lap time */
IF RC = 0 THEN
SAY "NEXTLAP : "RESULT
ELSE
SAY "ERROR : "RC
TEXTR 70 345 6 0 "5."
NEXTLAP /* get next additive lap time */
IF RC = 0 THEN
SAY "NEXTLAP : "RESULT
ELSE
SAY "ERROR : "RC
CLRTEXTR 70 345 "5."
TEXTR 70 345 6 0 "12."
NEXTLAP /* get next additive lap time */
IF RC = 0 THEN
SAY "NEXTLAP : "RESULT
ELSE
SAY "ERROR : "RC
LOCKTIMER
CLRTEXTR 70 345 "12."
TEXTR 70 345 6 0 "3."
LOGO 280 325
ADDRESS COMMAND "Wait 2 Sec"
CLRLOGO 280 325
CLRTEXTR 70 345 "3."
TIMECOLOR 5 2
TIMEDIGITS 0 2 /* resolution of time display */
RESET /* reset of the timer */
NEXTSINGLE /* get next single lap time */
IF RC = 0 THEN
SAY "NEXTSINGLE : "RESULT
ELSE
SAY "ERROR : "RC
NEXTSINGLE /* get next single lap time */
IF RC = 0 THEN
SAY "NEXTSINGLE : "RESULT
ELSE
SAY "ERROR : "RC
LOCKTIMER
TEXTR 70 345 6 0 "5."
ADDRESS COMMAND "Wait 2 Sec"
CLRTEXTR 70 345 "5."
RESET /* reset of the timer */
TIMEPOS 485 325 485 345 485 355 /* change positions of time display */
TIMECOLOR 5 0
TIMEDIGITS 1 3
LAPS 2 /* modifying laps per race, reset */
LOGO 150 325
NEXTLAP /* get next additive lap time */
IF RC = 0 THEN
SAY "NEXTLAP : "RESULT
ELSE
SAY "ERROR : "RC
TEXTRS 70 345 6 2 "15."
TEXTRS 350 345 6 2 "+ 1:14.947"
NEXTTOTAL /* get next total time */
/* here StopWatch.pic was recorded !! */
IF RC = 0 THEN
SAY "NEXTTOTAL : "RESULT
ELSE
SAY "ERROR : "RC
LOCKTIMER
CLRTEXTRS 70 345 "15."
CLRTEXTRS 350 345 "+ 1:14.947"
TEXTRS 70 345 6 2 "7."
ADDRESS COMMAND "Wait 2 Sec"
CLRTEXTRS 70 345 "7."
PREVSINGLE /* get previous single lap time */
IF RC = 0 THEN
SAY "PREVSINGLE : "RESULT
ELSE
SAY "ERROR : "RC
PREVLAP /* get previous additive lap time */
IF RC = 0 THEN
SAY "PREVLAP : "RESULT
ELSE
SAY "ERROR : "RC
PREVTOTAL /* get previous total lap time */
IF RC = 0 THEN
SAY "PREVTOTAL : "RESULT
ELSE
SAY "ERROR : "RC
CLRLOGO 150 325
RESET /* reset of the timer */
PREVSINGLE /* get prev. single lap time -> error */
IF RC = 0 THEN
SAY "PREVSINGLE : "RESULT
ELSE
SAY "PREVSINGLE : "RESULT
SAY "ERROR : "RC
PREVLAP /* get previous additive lap time */
IF RC = 0 THEN
SAY "PREVLAP : "RESULT
ELSE
SAY "PREVLAP : "RESULT
SAY "ERROR : "RC
PREVTOTAL /* get previous total lap time */
IF RC = 0 THEN
SAY "PREVTOTAL : "RESULT
ELSE
SAY "PREVTOTAL : "RESULT
SAY "ERROR : "RC
IF STARTED = 1 THEN
CLOSE /* end the earlier started program */
EXIT