This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
recipes:user_interaction [2009/11/12 18:44] deryn.crockett created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== User Interaction Through Views ====== | ||
- | Views are special TOOL scripts that can create or display model variables within the Scenario and Model Manager (SAMM). Views may interact with a user to either prompt the user to enter information or to provide the user with status updates as the view runs. TOOL provides the following commands for screen input and output: | ||
- | |||
- | ^ Command ^ Syntax ^ Description ^ | ||
- | | listen | listen (constant string, TOOL variable)| prompts the user for input | | ||
- | | say | say (expression1, expression2, ...) | displays strings, constants and TOOL variables on the screen then moves the cursor to a new line | | ||
- | | mumble | say (expression1, expression2, ...) | displays strings, constants and TOOL variables on the screen but does not move the cursor to a new line | | ||
- | | menu | menu (prompt, numItems, item1, ..., itemN, $choices[]) | displays a menu on the screen and allows a user to select an item | | ||
- | |||
- | |||
- | ===== Listen Command ===== | ||
- | The listen command is used to prompt the user for input from within a TOOL script. The snytax of the listen command is: | ||
- | listen (constant string, TOOL variable) | ||
- | where | ||
- | constant string is a string of alphanumeric characters enclosed by quotation marks " ". This | ||
- | string is the prompt that the user will see before entering data. | ||
- | TOOL variable is the variable into which the entered data is placed. If this is an integer variable, | ||
- | only an integer value can be entered. If this is a boolean variable, the | ||
- | possible values that can be entered are {yes, y, true, 1} or {no, n, false, 0}. | ||
- | These can also be entered as upper case letters. | ||
- | Say Command | ||
- | The say command is used to display strings, constants and TOOL variables on the screen. After | ||
- | displaying the strings, constants or TOOL variables, the say command will move the cursor to a | ||
- | new line. The syntax of the say command is: | ||
- | say (expression1, expression2, ...) | ||
- | where | ||
- | expressionN is an integer constant, a string of alphanumeric characters enclosed by quotation | ||
- | marks " ", or a TOOL variable. If the TOOL variables are boolean, the | ||
- | strings "true" or "false" will be displayed. The cursor will be moved to a new | ||
- | line after this command is finished. | ||
- | Mumble Command | ||
- | The mumble command is used to display strings, constants and TOOL variables on the screen. | ||
- | Mumble differs from say in that mumble does not put the cursor on a new line when it is finished. | ||
- | The syntax of the mumble command is: | ||
- | mumble (expression1, expression2, ...) | ||
- | where | ||
- | expressionN is an integer constant, a string of alphanumeric characters enclosed by quotation | ||
- | marks " ", or a TOOL variable. If the TOOL variables are boolean, the | ||
- | strings "true" or "false" will be displayed. All expressions will be displayed on | ||
- | the same line and the cursor will remain on the same line. | ||
- | Menu Command | ||
- | The menu command is used to display a menu on the screen and allow you to select items from | ||
- | the menu. The syntax of the menu command is: | ||
- | menu (prompt, numItems, item1, ..., itemN, $choices[]) |