|
From: Tobias G. <gut...@fz...> - 2003-08-01 14:20:23
|
Hi!
While making ask() a global function rather than a statement, I observed
what strange usage ask() used to have:
It required 2 or 3 parameters.
Param 1: A string, the question ask (so far so well)
usage no 1:
Param 2: A VariableDeclaration. Depending on it's type, the user would
be ask for "true/false", an integer value, and so on. The variable's
content would then be overwritten.
usage no 2:
Param 2: A list to choose from.
Param 3: A string (!) which contains the name of a variable that is used
as the default return value. The chosen return value would then be
stored in this variable's content.
e.g.:
a = classes;
b = a.getElement(0);
ask("What class do you want to delete?", a, "b");
// the return value is now stored in b.
My suggestions:
- Do not store the return value in the 2nd (or 3rd) parameter; rather
have ask() return the result;
- as second parameter, pass either an integer value defining the type to
ask for, or a list to choose an element from
- as an optional third parameter, pass the element selected by default
if second element is a list
If there are no objections/improvements, I'll implement it this way.
Have a nice weekend everyone!
Tobias
|