home *** CD-ROM | disk | FTP | other *** search
-
- /* This is a comment which must begin a Arexx script at ALL times! */
-
- /* This is a "Nested" Comment /* (A comment within another comment) */ */
-
- call time('R')
-
- /* Start the Elapsed time counter.. This will come in handy l8er.. */
-
- Address command
-
- /* Set the output address of commands to the CON: (Shell) */
-
- 'cls'
- 'echo " .------------------------------------------------------------."'
- 'echo " | This is an example Arexx script by Fusion/LNS^dSY in 1996. |"'
- 'echo " `------------------------------------------------------------''"'
- 'echo " Type your name or Alias Backwards and press Enter.."'
-
- /* Send the commands above to the "command" address (Shell) */
-
- Address
-
- /* Return to the previous address (Default REXX port Address) */
-
- say ''
-
- /* Normal way to make a linefeed.. */
-
- pull Name
-
- say ''
-
- /* Wait for input and store the input in the variable "Name" */
-
- say ' So your name or Alias is 'Reverse(Name)'!:.'
-
- /* Reverse the name entered backwards to get it right and print it */
-
- say ''
-
- /* Simple way of getting a linefeed.. */
-
- Address command 'waitreturn'
-
- /* Use C: command "Waitreturn" from CLI */
-
- Address
-
- /* Restore the Address to REXX port */
-
- Signal on break_E
-
- /* Jump to Label Clause "BREAK_E" when you press CTRL-E */
-
- bc = 0
-
- /* Assign value 0 to the variable bc */
-
- do forever
-
- /* Start a DO loop and execute all between DO and END unlimited times */
-
- say value(bc)
-
- /* Print the current value of the variable "bc" */
-
- bc = bc+1
-
- /* give variable "bc" a new value (its original value +1) */
-
- say ' Press CTRL-E Now to stop this Looping!:.'
-
- /* Print this string in the shell window */
-
- end
-
- /* End of the DO loop (MUST ALWAYS be present when DO is used!) */
-
- BREAK_E:
-
- /* This is a "Label Clause" in which it will jump to on a CTRL+E break */
-
- say ''
- say " Good, It was repeated "bc" times before you made the brake!:."
-
- /* Print this string with bc (amount of times the break message printed) */
-
- say ''
- say ' Enter your current Age in years please..'
-
- pull Age
-
- say ''
-
- /* You know now what this above means right?! */
-
- if Age > 15 then call AGEMAX
-
- /* If the age in years is above 15 call Label Clause "AGEMAX" */
-
- else
-
- /* If the Age was below 15 then continue here.. */
-
- call AGEMIN
-
- /* Call Label Clause "AGEMIN" */
-
- AGEMAX:
-
- /* "AGEMAX" Label clause */
-
- say ' Allright, you are old enough.. '
-
- call CONTINUE
-
- /* Print string and jump to Label Clause "CONTINUE" */
-
- AGEMIN:
-
- say ' Humm, You are still a kid!:. ;)'
-
- CONTINUE:
-
- say ''
- say ' Enter some numbers with a space between each of them..'
- say ''
-
- pull numbs
-
- say ''
- say " Allright, lets add them.. "Space(numbs,'1','+')" is?:."
- say ''
-
- /* Print strings, And fill spaces in numbers given with +'es */
-
- pull amo
-
- call random(,, time(s))
- tms = random(1,9)
-
- /* Assign a random number value between 1 and 9 to variable "tms" */
-
- say ''
- say " The numbers added times "tms" is.. "tms*amo"!:."
-
- /* print result of numbers and result of times the random number. */
-
- say ''
- say ' Now enter a sentence of a couple of words..'
- say ''
-
- pull sent
-
- /* Print strings and get input to variable "sent" */
-
- wrs = words(sent)
-
- /* Get amount of words variable "sent" contains to variable "wrs" */
-
- chr = length(space(sent,0))
-
- /* assign value on lenght of input "sent" without Spaces to the variable */
- /* "chr" "Space(sent,0)" strips ALL spaces and length() gives # chars.. */
-
- say ''
- say " You wrote "chr" characters (without spaces) in the sentence."
- say " And you totally used "wrs" Word(s) in it.."
- say ''
-
- /* Send string with value of variable "chr" */
-
- options prompt " Continue this program? (Y/n): "
-
- /* Print a prompt with the string between the "" characters.. */
-
- pull well
-
- /* Get input from user and put it in variable "well" */
-
- if well = Y then call GREEN
-
- /* if variable well was Y or y then call label clause "GREEN" */
- /* if variable well is anything else then Y or y continue here */
-
- say ''
- say ' Thanx for using LearnArexx v1.1 (c) by Fusion/lNS^dSY 1996..'
- say ''
-
- exit
-
- GREEN:
-
- say ''
- say " Ok, You have been in the program for "time('E')" seconds now."
- say ''
-
- /* Print linefeeds and string with elapsed time total.. ( time('E') ) */
-
- options
-
- /* Reset Options settings to their defaults.. */
-
- say ' Allright.. Enter to continue..'
-
- pull
-
- say ''
-
- /* Wait for a keypress.. */
-
- address command 'cls'
-
- /* Use C: Command CLS in CLI on the Shell windows address.. */
-
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "H/\"
- echo "H "
- echo "0H/\"
- echo "0H "
- echo "1H/\"
- echo "1H "
- echo "2H/\"
- echo "2H "
- echo "3H/\"
- echo "3H "
- echo "4H/\"
- echo "4H "
- echo "5H/\"
- echo "5H "
- echo "6H/\"
- echo "6H "
- echo "7H/\>"
- echo "7H/\÷>"
- echo "7H/\-÷>"
- echo "7H/\--÷>"
- echo "7H/\---÷>"
- echo "7H/\----÷>"
- echo "7H/\-----÷>"
- echo "7H/\------÷>"
- echo "7H/\------÷> F"
- echo "7H/\------÷> Fu"
- echo "7H/\------÷> Fus"
- echo "7H/\------÷> Fusi"
- echo "7H/\------÷> Fusio"
- echo "7H/\------÷> Fusion"
- echo "7H/\------÷> Fusion."
- echo "7H/\------÷> Fusion.."
-
- /* An ASCII animation by Me.. Using Arexx ECHO command in CLI.. */
-
- say ''
-
- /* Normal linefeed.. */
-
- say ' Hiya [ 'centre(reverse(name),50)' ]'
-
- /* Print [ Hiya "Name" ] reversed and centered in a 50 character space! */
-
- say ''
- say ' Enter A word, How many times on 1 line it should be printed,'
- say ' And how many lines it should be printed on. (ex. cool 3 2): '
- say ''
-
- pull cpa cpb cpc
-
- /* Print strings and pull three values for three variables.. */
-
- say ''
-
- do ""cpc""
-
- say ''copies(cpa,''cpb'')''
-
- end
-
- say ''
-
- /* A loop that prints word in variable "cpa" "cpb" times on each line */
- /* And over value of variable "cpc" lines.. */
-
- if ~exists('SYS:S/User-Startup') then call NO
-
- /* If U dont have User-Startup in SYS:S/ directory call NO label clause */
-
- call YES
-
- /* Call (jump) to label clause named "YES:" */
-
- NO:
-
- say 'What!? You haven''t got any User-Startup file in SYS:S/ dir!:.'
- say ''
- say 'Enter to continue..'
- say ''
-
- pull
-
- call MOVE
-
- YES:
-
- say ' The file SYS:S/User-Startup is present in your system..'
- say ''
- say ' Enter to continue..'
-
- pull
-
- MOVE:
-
- say ' Enter 3 numbers on one line seperated by a space each..'
- say ''
-
- pull nu1 nu2 nu3
-
- say ''
- say ' Now lets take the highest number of them and devide it by 3..'
- say ''
-
- /* All of this you sure as heckfire know by now.. */
-
- ops = Max(nu1,nu2,nu3)
-
- /* Assign value of the highest number of the 3 entered 2 variable "ops" */
-
- numeric digits 6
-
- /* All numeric calculations should have 6 digits precision! */
-
- got = ops / 3
-
- /* Devide variable ops with 3 and assign the new value 2 variable "got" */
-
- say ' Well, 'ops' devided by 3 is.. 'got'!:.'
- say ' That is with 6 digits of precision..'
- say ''
-
- /* Give the string with higest number and the devided by 3 result */
-
- options prompt " Continue this program? (Y/n): "
-
- pull well
-
- if well = Y then call GREEN2
-
- say ''
-
- exit
-
- /* This time I overwrite the old value of variable well to a new one! */
-
- GREEN2:
-
- options
-
- /* Reset the options argument.. */
-
- address command 'cls'
-
- say ''
- say ' And now for some info about YOUR Arexx interpreters enviorment!'
- say ''
-
- /* Basic stuff you REALLY should know about at this moment.. */
-
- parse version ver
-
- /* Get the Interpreter Enviorment Version string into variable "ver" */
-
- say ' 'ver''
- say ''
- say ' Answers: Arexx Version?, CPU?, FPU?, VIDEO?, FREQUENCY?'
- say ''
- say ' Enter to continue...'
-
- pull
-
- /* Nice output on system information.. */
-
- call open('Text','RAM:Story.txt','W')
-
- /* Create new file in RAM: called Story.txt and be ready to write data */
- /* Into that file called "Text" with the writeln commands later on.. */
-
- say ' Enter a nice little story over three lines (Return after each)..'
- say ''
-
- pull lin1
- pull lin2
- pull lin3
-
- /* Print strings and get the "3 line story" into three variables.. */
-
- call writeln('Text',''lin1'')
- call writeln('Text',''lin2'')
- call writeln('Text',''lin3'')
-
- /* write the three "story" lines into the opened (Text) file in RAM: */
-
- call close('Text')
-
- /* close the opened file RAM:Story.txt, we have finished using it.. */
-
- address command
-
- 'cls'
- 'echo ""'
- 'type RAM:Story.txt'
-
- /* Make Shell window HOST and execute commands in that host address.. */
-
- address
-
- /* Return host to REXX port.. The default port for Arexx scripts.. */
-
- say ''
- say ' Well, Thats your story.. You can find the story in a file called'
- say ' Story.txt in your RAM: disk.. for later use maybe..'
- say ''
- say ' Enter to go on..'
-
- pull
-
- /* Some strings and a "Arexx" simulated waitreturn command.. */
-
- options prompt ' Do you want to delete the story textfile in RAM? (y/N): '
-
- pull del
-
- if del = Y then call DELETE
-
- say ''
- say ' Allright, The text was not deleted and is present in device RAM!'
- say ''
- say ' Enter to move it all on further..'
-
- options
-
- pull
-
- /* This you should already know if you have read everything carefully.. */
-
- END:
-
- address command 'cls'
-
- say ''
- say ' Well, You have now on 'Date()' reached the end of Fusions'
- say ' LearnArexx v1.1, hope you liked it.. Edit the source with'
- say ' Your favorite Editor and have a look on how it was made!:.'
- say ' This source is (c) by Fusion 1996 and if you are going to'
- say ' cut out and use anything in this I whould appriciate it if'
- say ' you mentioned me in the docs/sources or whatever.. Or you'
- say ' can mention me if you learned much here that helped you'
- say ' with whatever you code in the docs or in the Program/Game.'
-
- say ''
-
- /* A little END text.. And an important one too.. */
-
- exit
-
- /* Exit (Quit) The program and return nicely to the system.. */
-
- DELETE:
-
- address command 'delete >NIL: RAM:Story.txt'
-
- /* Execute line between '' characters in CLI.. */
-
- say ''
- say ' Allright, The story file has been succesfully deleted..'
- say ''
- say ' Enter to move on..'
-
- /* Print a couple of strings.. */
-
- options
-
- /* Return options value to defaults.. */
-
- pull
-
- /* Wait for a input.. */
-
- call END
-
- /* Call (Jump To) Label Clause named "END" */
-
- exit
-
- /* Exit the program and give full control back to shell.. */
-
-