home *** CD-ROM | disk | FTP | other *** search
- AddToPath v1.00, Copyright (C) Olly Betts 1994,1996
-
- Provided "as is". I take no responsibility for any problems, or side
- effects. Freely distributable with no restrictions, so you may use it
- in the !Run or !Boot file of any application. It is 256 bytes in size,
- so won't take up much room. Please make it clear if you have modified
- a version and are distributing it.
-
- Syntax: AddToPath <path variable> <path element>
-
- Eg. *AddToPath Run$Path <UnixBin$Dir>.
-
- Adds <path element> to <path variable> if it isn't already in there.
- Matching is case sensitive (case may be significant, e.g. on NFS), so be
- consistent with your capitalisation. If the element needs to be added,
- it is appended to the end of the path variable, separated by a comma.
- Spaces are removed from the existing path variable to try to keep the
- length down.
-
- Put simply, "AddToPath X$Path Element" does:
-
- *SetMacro X$Path <X$Path>,NewElement
-
- except that X$Path isn't altered if it already contains NewElement.
-
- To add more than one element to a path, call AddToPath twice -- if you
- ask it to add something with a comma in, it will *always* get added.
-
- If AddToPath alters the path variable it will turn it into a macro (since
- this is usually what is wanted, and it helps keep the path variable short).
- Incidentally, AddToPath will cope if some joker has set the path variable
- to be a numeric variable.
-
- If the path variable grows longer than 1024 characters (the size of the
- workspace RISC OS gives utilities) then AddToPath will fail (possibly not
- very cleanly). For most uses this is probably not a problem. If it is
- for you, the source code is provided (send me a copy too).
-
- Hope you find it useful,
- Olly
- 1996.11.18
-
- Internet e-mail:
- olly@muscat.co.uk (NB new address as of November 1996)
-
- Post:
- Olly Betts,
- 24 Morgans Road,
- Hertford,
- Herts,
- SG13 8BS
-
- Revision History:
-
- 1.00 Jumped version number since I've had no bug reports in 2 years
- Now prints version number if run with less than 2 arguments
-
- 0.02 Syntax altered to *AddToPath Run$Path <UnixBin$Dir>.
-
- 0.01 Original version which only worked on Run$Path
-