home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 2
/
amigaformatcd02.iso
/
demos
/
mmexperience
/
arexxscripts
/
quiz.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-05-20
|
2KB
|
66 lines
/*
MME AREXX SCRIPT - A QUIZ APPLICATION
Copyright (c) 1995 Optonica Limited
Written by Kevin Stevens
This script is called by MME from a media clip to increment
the users score held in a result file
Enter these arguments in the MME Program arguments area
1 NEW (first time CORRECT)
0 NEW (first time WRONG)
1 (second & subsequent times CORRECT)
0 (second & subsequent times WRONG)
1 DONE (last time CORRECT)
0 DONE (last time WRONG)
You can set the good and merit variables below to set the pass marks
You will also need to create the required media clips in MME
*/
/* get the callers argument(s) */
parse upper arg increment option
good = 10 /* quiz pass mark */
merit = 15 /* quiz merit pass mark */
value = 0 /* initialise the result variable */
resultFileName = "T:MME_Result" /* name of the result file to use */
/* read a result from an existing result file (if its NOT a new user) */
if option ~= "NEW" then do
if open( ResultFile, resultFileName, Read) ~= 0 then do
value = ReadLn( ResultFile )
close( ResultFile )
end
end
/* increase the result and write out the NEW result */
value = value + increment
if open( ResultFile, resultFileName, Write) ~= 0 then do
WriteLn( ResultFile, value)
close( ResultFile)
end
/* test if it's the last time this script is called - if so show an mclip */
if option = "DONE" then do
ADDRESS COMMAND ('C:Delete '||resultFileName||' QUIET')
if show('P',"TOMMEPORT") then do
if value >= merit then do
ADDRESS TOMMEPORT MEDIACLIP "s/quizMerit.mclip"
end
else if value >= good then do
ADDRESS TOMMEPORT MEDIACLIP "s/quizPass.mclip"
end
else do
ADDRESS TOMMEPORT MEDIACLIP "s/quizFail.mclip"
end
end
else do
say "MME not running. Score = "||value
end
end
/* all done */
exit