Home » Archimedes archive » Acorn User » AU 1995-05.adf » !Internet_StarterPak » !TCPIP/TCPIP_Doc/Notes/Variables

!TCPIP/TCPIP_Doc/Notes/Variables

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 » Acorn User » AU 1995-05.adf » !Internet_StarterPak
Filename: !TCPIP/TCPIP_Doc/Notes/Variables
Read OK:
File size: 03A3 bytes
Load address: 0000
Exec address: 0000
File contents
Use of variables in TCPIP commands                  (v2.00g onwards)
==================================

Version of !TCPIP from 2.00g onwards have facilities for handling
string variables in commands and menu macros.

These variables may be embedded vitually anywhere, including in the
AutoExec, Config, Domain and resolve.ResConf files and in any commands
typed into the main command window, including of course, macros selected
from the command menu in the main window.

To create a variable, or re-assign a variable use the "set" command as
follows:

setvar <var_name> "<value>"

For example:

set user "adam"
set node "comptech"
set domain "demon.co.uk"

These variables are referenced by including them where needed,
surrounded by braces '{' and '}'. For example

set email  "{user}@{host}.{domain}"

Assuming user, node and domain have been set as above, this would result
in email being set to "adam@comptech.demon.co.uk".

00000000  55 73 65 20 6f 66 20 76  61 72 69 61 62 6c 65 73  |Use of variables|
00000010  20 69 6e 20 54 43 50 49  50 20 63 6f 6d 6d 61 6e  | in TCPIP comman|
00000020  64 73 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ds              |
00000030  20 20 20 20 28 76 32 2e  30 30 67 20 6f 6e 77 61  |    (v2.00g onwa|
00000040  72 64 73 29 0a 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |rds).===========|
00000050  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00000060  3d 3d 3d 3d 3d 3d 3d 0a  0a 56 65 72 73 69 6f 6e  |=======..Version|
00000070  20 6f 66 20 21 54 43 50  49 50 20 66 72 6f 6d 20  | of !TCPIP from |
00000080  32 2e 30 30 67 20 6f 6e  77 61 72 64 73 20 68 61  |2.00g onwards ha|
00000090  76 65 20 66 61 63 69 6c  69 74 69 65 73 20 66 6f  |ve facilities fo|
000000a0  72 20 68 61 6e 64 6c 69  6e 67 0a 73 74 72 69 6e  |r handling.strin|
000000b0  67 20 76 61 72 69 61 62  6c 65 73 20 69 6e 20 63  |g variables in c|
000000c0  6f 6d 6d 61 6e 64 73 20  61 6e 64 20 6d 65 6e 75  |ommands and menu|
000000d0  20 6d 61 63 72 6f 73 2e  0a 0a 54 68 65 73 65 20  | macros...These |
000000e0  76 61 72 69 61 62 6c 65  73 20 6d 61 79 20 62 65  |variables may be|
000000f0  20 65 6d 62 65 64 64 65  64 20 76 69 74 75 61 6c  | embedded vitual|
00000100  6c 79 20 61 6e 79 77 68  65 72 65 2c 20 69 6e 63  |ly anywhere, inc|
00000110  6c 75 64 69 6e 67 20 69  6e 20 74 68 65 0a 41 75  |luding in the.Au|
00000120  74 6f 45 78 65 63 2c 20  43 6f 6e 66 69 67 2c 20  |toExec, Config, |
00000130  44 6f 6d 61 69 6e 20 61  6e 64 20 72 65 73 6f 6c  |Domain and resol|
00000140  76 65 2e 52 65 73 43 6f  6e 66 20 66 69 6c 65 73  |ve.ResConf files|
00000150  20 61 6e 64 20 69 6e 20  61 6e 79 20 63 6f 6d 6d  | and in any comm|
00000160  61 6e 64 73 0a 74 79 70  65 64 20 69 6e 74 6f 20  |ands.typed into |
00000170  74 68 65 20 6d 61 69 6e  20 63 6f 6d 6d 61 6e 64  |the main command|
00000180  20 77 69 6e 64 6f 77 2c  20 69 6e 63 6c 75 64 69  | window, includi|
00000190  6e 67 20 6f 66 20 63 6f  75 72 73 65 2c 20 6d 61  |ng of course, ma|
000001a0  63 72 6f 73 20 73 65 6c  65 63 74 65 64 0a 66 72  |cros selected.fr|
000001b0  6f 6d 20 74 68 65 20 63  6f 6d 6d 61 6e 64 20 6d  |om the command m|
000001c0  65 6e 75 20 69 6e 20 74  68 65 20 6d 61 69 6e 20  |enu in the main |
000001d0  77 69 6e 64 6f 77 2e 0a  0a 54 6f 20 63 72 65 61  |window...To crea|
000001e0  74 65 20 61 20 76 61 72  69 61 62 6c 65 2c 20 6f  |te a variable, o|
000001f0  72 20 72 65 2d 61 73 73  69 67 6e 20 61 20 76 61  |r re-assign a va|
00000200  72 69 61 62 6c 65 20 75  73 65 20 74 68 65 20 22  |riable use the "|
00000210  73 65 74 22 20 63 6f 6d  6d 61 6e 64 20 61 73 0a  |set" command as.|
00000220  66 6f 6c 6c 6f 77 73 3a  0a 0a 73 65 74 76 61 72  |follows:..setvar|
00000230  20 3c 76 61 72 5f 6e 61  6d 65 3e 20 22 3c 76 61  | <var_name> "<va|
00000240  6c 75 65 3e 22 0a 0a 46  6f 72 20 65 78 61 6d 70  |lue>"..For examp|
00000250  6c 65 3a 0a 0a 73 65 74  20 75 73 65 72 20 22 61  |le:..set user "a|
00000260  64 61 6d 22 0a 73 65 74  20 6e 6f 64 65 20 22 63  |dam".set node "c|
00000270  6f 6d 70 74 65 63 68 22  0a 73 65 74 20 64 6f 6d  |omptech".set dom|
00000280  61 69 6e 20 22 64 65 6d  6f 6e 2e 63 6f 2e 75 6b  |ain "demon.co.uk|
00000290  22 0a 0a 54 68 65 73 65  20 76 61 72 69 61 62 6c  |"..These variabl|
000002a0  65 73 20 61 72 65 20 72  65 66 65 72 65 6e 63 65  |es are reference|
000002b0  64 20 62 79 20 69 6e 63  6c 75 64 69 6e 67 20 74  |d by including t|
000002c0  68 65 6d 20 77 68 65 72  65 20 6e 65 65 64 65 64  |hem where needed|
000002d0  2c 0a 73 75 72 72 6f 75  6e 64 65 64 20 62 79 20  |,.surrounded by |
000002e0  62 72 61 63 65 73 20 27  7b 27 20 61 6e 64 20 27  |braces '{' and '|
000002f0  7d 27 2e 20 46 6f 72 20  65 78 61 6d 70 6c 65 0a  |}'. For example.|
00000300  0a 73 65 74 20 65 6d 61  69 6c 20 20 22 7b 75 73  |.set email  "{us|
00000310  65 72 7d 40 7b 68 6f 73  74 7d 2e 7b 64 6f 6d 61  |er}@{host}.{doma|
00000320  69 6e 7d 22 0a 0a 41 73  73 75 6d 69 6e 67 20 75  |in}"..Assuming u|
00000330  73 65 72 2c 20 6e 6f 64  65 20 61 6e 64 20 64 6f  |ser, node and do|
00000340  6d 61 69 6e 20 68 61 76  65 20 62 65 65 6e 20 73  |main have been s|
00000350  65 74 20 61 73 20 61 62  6f 76 65 2c 20 74 68 69  |et as above, thi|
00000360  73 20 77 6f 75 6c 64 20  72 65 73 75 6c 74 0a 69  |s would result.i|
00000370  6e 20 65 6d 61 69 6c 20  62 65 69 6e 67 20 73 65  |n email being se|
00000380  74 20 74 6f 20 22 61 64  61 6d 40 63 6f 6d 70 74  |t to "adam@compt|
00000390  65 63 68 2e 64 65 6d 6f  6e 2e 63 6f 2e 75 6b 22  |ech.demon.co.uk"|
000003a0  2e 0a 0a                                          |...|
000003a3