Pref::promptString -- user
defined ``prompt''
IntroductionPref::promptString determines the string, that will be
printed in front of any input line--the ``prompt''.
Call(s)Pref::promptString( <prompt>)
Parametersprompt |
- | string, that contains the ``prompt'', or NIL |
Returnsthe last defined string
Related
FunctionsPref::prompt, Pref::postInput, Pref::postOutput
DetailsPref::promptString changes the user ``prompt''.Pref::postInput and Pref::postOutput the ``prompt'' can
be formed alterable (see example 2).Pref::promptString without arguments returns
the current value. The argument NIL will reset the default value, which
is »> ".
Example
1Prints out the current prompt:
>> Pref::promptString()
">> "
Example
2Pref::promptString will be used to numerate
the input lines in joint with Pref::postInput. I.e., after each
input the variable NumberOfLine will be incremented. The
variable NumberOfLine must be initialized with
0. (This all could be done in the file
``userinit.mu''.)
>> NumberOfLine:= 0:
Pref::postInput(proc()
begin
NumberOfLine:= NumberOfLine + 1;
Pref::promptString(expr2text(NumberOfLine) . " >> ")
end_proc):