Support of environment variables and command line parameters.

Andrew Butterfield Andrew.Butterfield@cs.tcd.ie
Thu, 13 Nov 1997 13:22:00 +0000


Ronny Wichers Schreur said:

>There have been a number of requests for support of environment
>variables and command-line arguments. We haven't added this
>support, because environment variables and command-line arguments
>are platform specific (read: the Mac doesn't have them).
.
.
.
>Meanwhile we'll think about a suitable
>interface for these features in a future official Clean release.

There is an approach here that was adopted by Think C to allow
Unix-like C programs to be quiclky got running on Macs.

What happens is that calls to getenv and similar cause the startup
behaviour on a Mac to change - a dialogue box pops  up, and the user
types in the command line arguments and hits return. Thse are stored
to be accessible to getenv within the program.

So - 1 "getenv" library interface.

Unix /DOS / Win95 - the use can supply command line arguments as normal

Mac - the program is launched as normal, and then it asks for arguments
before proceeding.

The way of starting programs and supplying arguments is different on each
platform, but the overall execution effect is the same.


P.S. Could Apple Event Scripts be used as an alternative aproach ?

_____________________________________________________________
Andrew Butterfield,                           Location: LG.19
Dept. of Computer Science,               Tel: +353-1-608-2517
O'Reilly Institute,                      Fax: +353-1-677-2204
Trinity College,
Dublin 2, IRELAND.        mailto:Andrew.Butterfield@cs.tcd.ie
URL:                 http://www.cs.tcd.ie/Andrew.Butterfield/