home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d8xx
/
d827
/
askreq.lha
/
AskReq
/
AskReq.doc
< prev
next >
Wrap
Text File
|
2001-02-25
|
9KB
|
274 lines
Documentation
AskReq 1.00
(c) and written 1992 H.P.G FreeWare
Index:
Index
What is AskReq
System Requirements
Legal Stuff
Starting AskReq
Cli Arguments
Examples
Technical
Address
List Of Files
What is AskReq:
AskReq is another batch requester tool. You will ask, why just another
requester tool. AskReq can ask the user to put in not only a okay or
cancel statement. You can also ask the user to give you text or integer
information. The results can be easily used in any kind of batch files.
It is nearly the same like the requester functions in the rexxarp.-
library. But it uses only OS 2.0 functions.
System Requirements:
AskReq needs at minimum OS 2.04 (37L) to run.
Legal Stuff:
This program and all files come with it, also the docfiles, are
released as FREEWARE.
this means:
everybody may use AskReq,
everybody may copy AskReq, if:
1. You copy all included files, see list at the end of the
doc file.
2. No changes are made, this means the program and all
included files must stay in the original form.
Exception: you may archieve it; but in this case you
must also archieve the whole package.
3. If you recompile it, you have to include a notice to
the original author. If you also want to (re)distribute
in any new form you have to send me a copy.
4. You may not sell AskReq.
Execption: you`re allowed to take a small copy fee
which should not extend 5 US$.
5. If you want to include AskReq or one of the included
files as a part of a commercial package, you must have
written permission from the author (address see below).
I take no warranty or guaranty for the function of this program.
The whole risk of using AskReq stays only by the user.
Starting AskReq:
AskReq can only be started from CLI. No wbench support at this time.
Alternatively you can of course use tools like XIcon or IconX to run
AskReq or use the `Execute Command ...` menu of your WBench or set the
tooltype CLI.
Cli Arguments:
If you start AskReq from CLI, it uses the following commandline
syntax:
Usage: AskReq [Hail=H/K]<Message=M/K>[Pos=P/K][Neg=N/K][GadgetText=G/K]
[STRING=S/K][INT=I/S][TimeOut=T/K/N]
with:
Hail
This is the title of the requester. If this arguments is omitted the
requester uses as default: `Ask Requester ...`
Message
This argument must be given. All others can be omitted. This
specifies the message you want give to the user. This may include
text for up to 4 lines. Each line is seperated by a `|`. If the text
contains spaces you must embedded the text in ""`s. There exists no
default Message.
Pos
This is the gadget text of the positive(left) gadget. If you specify
Pos this informs AskReq that you want to have a positive gadget. If
you doesn`t specify it no positive gadget will be displayed.
Neg
This is the gadget text of the negative(right) gadget. If you specify
Neg this informs AskReq that you want to have a negative gadget. If
you doesn`t specify it, no negative gadget will be displayed, but in
this case you must specify either String or Integer (see later). If
you do not specify String or Integer a default negative gadget will
be displayed with the text: `Proceed`
GadgetText
This is the text, the string or integer gadget should contain at
start time. This is the default text of the string or integer
gadget (see later). If you specify Integer, this is the default
number.
STRING
If you specify String a string gadget will be displayed.
default: none
INT
If you specify Integer an integer gadget will be displayed.
default: none
TimeOut
With TimeOut you can use an optionally timeout for the requester. The
requester will be closed after the given timeout in seconds. If omitted,
the requester stays open until the user answers it.
If the requester will be satisfied with the timeout, AskReq will return
0.
default: none
You can use string or integer gadget with or without pos and/or negative
gadgets.
If you specify no gadget the default negative gadget will be used.
If you only specify a string or integer gadget and no pos or neg gadget,
the requester will be satisfied by hitting return in the string or integer
gadget.
If you specify a pos and negative gadget and the positive will be clicked
AskReq returns 5 (WARN). This can be used in batchfiles as well as you
specify string or integer. This behaves exactly the same than the Ask cli
command.
Examples:
Here are some examples how to use AskReq from within batch files.
1.) Just a message requester
1.> AskReq M "This is version 1.00 of the|famous AskReq requester?"
There is no gadget specified, so the default negative gadget will be
used. The requester displays two lines of text.
2.) A boolean requester which lets the user chose two answers.
;----------- Batch file
AskReq M "This is version 1.00 of the|famous AskReq
requester?|Do you really like it?" POS "Oh Yes !!!" NEG "NO WAY"
; Open a requester with two gadgets and three lines of text
If WARN ; the user select `Oh Yes !!!`
echo "Oh this is fine :-)"
Else
echo "Why don`t you like me :-( ???"
Endif
;----------- END
3.) A requester which lets you put in your name and age asks you if its
really correct or not. This example is included as the example.bat
file.
;----------- Batch file
Set ANSW `AskReq M "Please tell me your name,|so I know where
you are!" S`
; Opens a requester with only a string gadget and two lines of text
; The result will be saved in the variable ANSW
Set AGE `AskReq M "And now tell me your age.|Are you really old
enough to ask|me something :-| ?" I`
; Opens a requester with only an integer gadget and three lines of text
; The result will be saved in the variable AGE
AskReq M "So I have got your datas|I will now Proceed"
; Just a notify requester
; Now we ask the user if the datas are really correct.
Set ANSW `AskReq M "You told me your name|Is this really your correct
name ?" S G $ANSW POS OKAY NEG "FORGET IT"`
; Opens a requester with a string and two boolean gadgets. The string
; gadget contains the input name
If $ANSW EQ "" ; No name specified
echo "You want to stay anonymous"
Else
echo "You name is"
echo $ANSW
Endif
Set AGE `AskReq M "You told me your age|Is this really your age ?"
I G $AGE POS OKAY NEG "FORGET IT"`
; Opens a requester with an integer and two boolean gadgets. The integer
; gadget contains the input age
If $AGE EQ "" ; No age specified
echo "You won`t tell me your age"
Quit 5
Else
echo "You are"
echo $AGE
echo "years old"
Endif
echo "Thank You " $ANSW " for your datas"
;----------- END
You see you can use AskReq for almost all batch file functions. AskReq
lets you make decisions and lets you jump to other labels etc.
Technical:
AskReq uses the gadtools.library and the readargs DOS functions.
It is completely written with Aztec C version 5.2. Source code is
available from the author.
Address:
Send all messages, bug reports mail, gifts etc. to the following address:
Hans-Peter Guenther
Gruener Weg 5
3501 Fuldatal 2
W-Germany
Have Fun ...
List Of Files:
The complete AskReq distribution includes the following files:
AskReq : the binary
AskReq.info
AskReq.doc : english manual
AskReq.doc.info
AskReq.dok : german manual
AskReq.dok.info
example1.bat : the 3rd example
example1.bat.info