Home » Archimedes archive » Archimedes World » AW-1993-10.adf » AWOct93 » !AWOct93/Goodies/Disc/!Extend/Commands/Parameter

!AWOct93/Goodies/Disc/!Extend/Commands/Parameter

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1993-10.adf » AWOct93
Filename: !AWOct93/Goodies/Disc/!Extend/Commands/Parameter
Read OK:
File size: 0369 bytes
Load address: 0000
Exec address: 0000
File contents
    1REM ============================================================
    2REM
    3REM Program : Parameters
    4REM Purpose : To illustrate how to read parameters when a BASIC
    5REM           program is *RUN
    6REM
    7REM Usage   : Type   *Parameters <Parameter list> at the command
    8REM           line
    9REM
   10REM ============================================================
   11
   12PRINT "The parameter list is"
   13PRINT FNGet_Parameters
   14END
   15:
   16:
   17:
   18:
   19DEF FNGet_Parameters
   20 REM
   21 REM -------------------------------------------------
   22 REM The value of this function is the parameter list
   23 REM following the command
   24 REM
   25 REM            *ProgramName <parameter list>
   26 REM
   27 REM -------------------------------------------------
   28 REM
   29 LOCAL param$,i%
   30 SYS "OS_GetEnv" TO param$
   31 PRINT param$
   32 i%=INSTR(param$," -quit ")
   33 IF i% THEN param$=MID$(param$,INSTR(param$," ",i%+LEN" -quit ")+1)
   34=param$
B� ============================================================
�
� Program : Parameters
A� Purpose : To illustrate how to read parameters when a BASIC
�           program is *RUN
�
B� Usage   : Type   *Parameters <Parameter list> at the command
�           line
	�

B� ============================================================

� "The parameter list is"

� �Get_Parameters
�
:
:
:
:
� �Get_Parameters
 �
8 � -------------------------------------------------
7 � The value of this function is the parameter list
 � following the command
 �
/ �            *ProgramName <parameter list>
 �
8 � -------------------------------------------------
 �
 � param$,i%
 ș "OS_GetEnv" � param$

 � param$
  i%=�param$," -quit ")
!8 � i% � param$=�param$,�param$," ",i%+�" -quit ")+1)
"=param$
�
00000000  0d 00 01 42 f4 20 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |...B. ==========|
00000010  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000040  3d 3d 0d 00 02 05 f4 0d  00 03 1a f4 20 50 72 6f  |==.......... Pro|
00000050  67 72 61 6d 20 3a 20 50  61 72 61 6d 65 74 65 72  |gram : Parameter|
00000060  73 0d 00 04 41 f4 20 50  75 72 70 6f 73 65 20 3a  |s...A. Purpose :|
00000070  20 54 6f 20 69 6c 6c 75  73 74 72 61 74 65 20 68  | To illustrate h|
00000080  6f 77 20 74 6f 20 72 65  61 64 20 70 61 72 61 6d  |ow to read param|
00000090  65 74 65 72 73 20 77 68  65 6e 20 61 20 42 41 53  |eters when a BAS|
000000a0  49 43 0d 00 05 1f f4 20  20 20 20 20 20 20 20 20  |IC.....         |
000000b0  20 20 70 72 6f 67 72 61  6d 20 69 73 20 2a 52 55  |  program is *RU|
000000c0  4e 0d 00 06 05 f4 0d 00  07 42 f4 20 55 73 61 67  |N........B. Usag|
000000d0  65 20 20 20 3a 20 54 79  70 65 20 20 20 2a 50 61  |e   : Type   *Pa|
000000e0  72 61 6d 65 74 65 72 73  20 3c 50 61 72 61 6d 65  |rameters <Parame|
000000f0  74 65 72 20 6c 69 73 74  3e 20 61 74 20 74 68 65  |ter list> at the|
00000100  20 63 6f 6d 6d 61 6e 64  0d 00 08 14 f4 20 20 20  | command.....   |
00000110  20 20 20 20 20 20 20 20  6c 69 6e 65 0d 00 09 05  |        line....|
00000120  f4 0d 00 0a 42 f4 20 3d  3d 3d 3d 3d 3d 3d 3d 3d  |....B. =========|
00000130  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000160  3d 3d 3d 0d 00 0b 04 0d  00 0c 1d f1 20 22 54 68  |===......... "Th|
00000170  65 20 70 61 72 61 6d 65  74 65 72 20 6c 69 73 74  |e parameter list|
00000180  20 69 73 22 0d 00 0d 15  f1 20 a4 47 65 74 5f 50  | is"..... .Get_P|
00000190  61 72 61 6d 65 74 65 72  73 0d 00 0e 05 e0 0d 00  |arameters.......|
000001a0  0f 05 3a 0d 00 10 05 3a  0d 00 11 05 3a 0d 00 12  |..:....:....:...|
000001b0  05 3a 0d 00 13 15 dd 20  a4 47 65 74 5f 50 61 72  |.:..... .Get_Par|
000001c0  61 6d 65 74 65 72 73 0d  00 14 06 20 f4 0d 00 15  |ameters.... ....|
000001d0  38 20 f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |8 . ------------|
000001e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000200  2d 2d 2d 2d 2d 0d 00 16  37 20 f4 20 54 68 65 20  |-----...7 . The |
00000210  76 61 6c 75 65 20 6f 66  20 74 68 69 73 20 66 75  |value of this fu|
00000220  6e 63 74 69 6f 6e 20 69  73 20 74 68 65 20 70 61  |nction is the pa|
00000230  72 61 6d 65 74 65 72 20  6c 69 73 74 0d 00 17 1c  |rameter list....|
00000240  20 f4 20 66 6f 6c 6c 6f  77 69 6e 67 20 74 68 65  | . following the|
00000250  20 63 6f 6d 6d 61 6e 64  0d 00 18 06 20 f4 0d 00  | command.... ...|
00000260  19 2f 20 f4 20 20 20 20  20 20 20 20 20 20 20 20  |./ .            |
00000270  2a 50 72 6f 67 72 61 6d  4e 61 6d 65 20 3c 70 61  |*ProgramName <pa|
00000280  72 61 6d 65 74 65 72 20  6c 69 73 74 3e 0d 00 1a  |rameter list>...|
00000290  06 20 f4 0d 00 1b 38 20  f4 20 2d 2d 2d 2d 2d 2d  |. ....8 . ------|
000002a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000002c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 00 1c 06 20  |-----------.... |
000002d0  f4 0d 00 1d 10 20 ea 20  70 61 72 61 6d 24 2c 69  |..... . param$,i|
000002e0  25 0d 00 1e 1c 20 c8 99  20 22 4f 53 5f 47 65 74  |%.... .. "OS_Get|
000002f0  45 6e 76 22 20 b8 20 70  61 72 61 6d 24 0d 00 1f  |Env" . param$...|
00000300  0d 20 f1 20 70 61 72 61  6d 24 0d 00 20 1a 20 69  |. . param$.. . i|
00000310  25 3d a7 70 61 72 61 6d  24 2c 22 20 2d 71 75 69  |%=.param$," -qui|
00000320  74 20 22 29 0d 00 21 38  20 e7 20 69 25 20 8c 20  |t ")..!8 . i% . |
00000330  70 61 72 61 6d 24 3d c1  70 61 72 61 6d 24 2c a7  |param$=.param$,.|
00000340  70 61 72 61 6d 24 2c 22  20 22 2c 69 25 2b a9 22  |param$," ",i%+."|
00000350  20 2d 71 75 69 74 20 22  29 2b 31 29 0d 00 22 0b  | -quit ")+1)..".|
00000360  3d 70 61 72 61 6d 24 0d  ff                       |=param$..|
00000369