home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************
- ** **
- ** GBRoute Plus ARexx Script **
- ** **
- ** (c) 1991 Complex Computers **
- ** **
- ** Name : gbrbias.rexx **
- ** **
- ** Description : Calculates a route from Cromer to Lyme Regis **
- ** with progressively increasing B road Bias **
- ** **
- *****************************************************************************/
-
- TEMPFILE = 'ram:$$temp' /* This can be any valid filename */
-
- say 'GBRoute Plus Bias Demonstration'
-
- start = Cromer
-
- dest = Lyme Regis
-
- options results /* neeed this if we are to get */
- /* returned values */
- address 'GBR'
-
- 'from' start /* give GBR start and destination */
- p1 = result
- 'to' dest
- p2 = result
-
- say 'Calculating journey from: 'p1' to: 'p2
-
- do i=1 to 6 /* loop with biasb from 1 to 6 */
- 'biasb' i /* set B road bias */
-
- say 'With B Road Bias at : 'i
-
- 'go' /* calculate the route */
-
- /* Check for no route */
- if result == 'RESULT' then do
- /* output journey to file */
- 'file' TEMPFILE
-
- open(file, TEMPFILE, read)
- /* loop until the end of the file */
- do while eof(file)=0
- /* read a line from file */
- st = readln(file)
- /* and print it */
- say st
- end
- /* close the file */
- close(file)
-
- address command /* call DOS delete command */
- delete TEMPFILE
-
- address 'GBR' /* now back to GBRoute */
-
- 'dist' /* get distance, time and cost */
- d = result
- 'time'
- t = result
- 'cost'
- c = trunc(result/100,2) /* convert to pounds.pence */
-
- say 'This journey costs £'c' and takes 't'mins covering 'd' miles'
- end
- /* Route not possible */
- else say result
- end
-
- exit /* exit ARexx script */
-