| This sounds familiar (see 4220.*). AmigaDOS doesn't support this function
directly, so I wrote a little utility to do so. It stores the user input
as a environment variable, which can then be expanded with a $env_var.
tape::user2:[upload]inquire.zoo
inquire.readme
/*
* Stephen Spodaryk 26-Oct-1990
* [email protected]
*
* Purpose:
*
* Short program to perform a basic "inquire" functionality.
* The environment variable is set equal to the user's input.
*
* By default, the entered string will have the control characters
* removed, and will trim off trailing blanks. Some basic punctuation
* is appended to the prompt.
*
* Format:
*
* inquire prompt_string environment_variable [-c -t -p -y | -n]
*
* Options:
*
* -c option will disable space substitution for control characters.
*
* -t option will disable trimming of trailing blanks.
*
* -p option will disable punctuation on the prompt. Normally, this
* is just a ": ". When used with -y | -n it becomes " [YES/no]: ",
* and " [NO/yes]: " respectively.
*
* -y option will set the variable to "yes" or "no", based on
* the first character of the string entered: N|n = "no",
* Y|y|no input = "yes".
*
* -n option will set the variable to "no" or "yes", based on
* the first character of the string entered: Y|y = "yes",
* N|n|no input = "no".
*
* Note:
*
* -y and -n are mutually exclusive. If non YyNn input is given,
* a WARN will be returned, and no variable will be set.
*
* Any other parameters are ignored.
*
* Specification:
*
* If the inquiry is aborted, the variable will not be set (unless
* you've specified -y or -n, in which case the default will be used)
*
* When the variable is set, "inquire" will return a 0 condition,
* and the variable can be used normally. If the variable is not set, a
* 5 (WARN) is set upon exit.
*
* Naturally, you'll need ENV: assigned in order to use the
* environment variables.
*
* See the "example.script" for a useable example.
*
* Disclaimer:
*
* I'll admit that I'm not super knowledgable about AmigaDOS script
* files, so if you'd like extra functionality, let me know. This
* started out really small, and kept growing as I thought up new things.
*
* Feel free to add_to/improve it. Could this be a WB2.0 command?
*
*/
|
| I just went through the same scenario. I ended up using ARexx which
makes the task very simple.(very, very simple) I suggest getting
ARexx, it is inexpensive($30US) and makes writing scripts and generally
controlling your user environment a lot easier. Here is a description
of my script:(it took about 6 lines of code in ARexx)
I wanted to start an incremental backup using Quarterback from a pull-down
menu with a date that I provided. I use ParM for menus. ParM opens a
small CLI window and starts my ARexx script which prompts me for a
date, when the date is entered CORRECTLY it passes it to Quarterback
which starts up and does its thing.
Great stuff, that Arexx. I didn't answer your question, sorry.
md
|
| Yup, 2.0 ships with ARexx - the user half of it. Shared libraries, commands,
and documentation on programming in ARexx.
However, it doesn't have the programmer half of it - header files, link
libraries, and documentation on adding an ARexx interface to your program.
If/when CBM starts providing that information (it's licensed from the author,
and I don't know the details of that license; but ARexx is _not_ the same as
the rest of the system, so they may not), they'll probably charge $20 or more
for it.
So - if you're a programmer - consider that you're putting a $10 investement
into getting an early start with ARexx. I'd recommend it, but I'm biased -
I think ARexx is the best money I've spent on my Amiga.
<mike
|