| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #PROMPT (prompt for programmer input) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ project add file to project .htm#extendedproject|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ prompt entry types.htm|{{btn_next_n.gif|Next page}}]] | | || | | **#PROMPT** | **(** //string//, //type// **)** [, //symbol// ] [, **REQ** ] [, **DEFAULT(** //default// **)** ] [, **ICON(** //file //**)** ] [, **AT( )** ] | | | | [, **PROMPTAT( )** ] [, **MULTI(** //description// **)** ] [, **UNIQUE **] [, **INLINE **] [, **VALUE( **//value//** ) **] | | | | [, **SELECTION(** //description// **)** ] [, **CHOICE **] [, **WHENACCEPTED( **//expression//** ) **] | | | | [, **HSCROLL **] [, **PROP( **//name,value//** )** ] | {{blk2blue.jpg|blk2blue.jpg}} | **#PROMPT** | Asks the programmer for input. | | //string// | A string constant containing the text to display as the input prompt. This may contain an ampersand (&) denoting a "hot" key used in conjunction with the ALT key to get to this field on the properties screen. | | //type// | A picture token or prompt keyword. | | //symbol// | A User-defined symbol to receive the input. A #PROMPT with a RADIO or EMBED //type// cannot have a //symbol//, all other //types// must have a //symbol//. | | **REQ** | Specifies the prompt cannot be left blank or zero. | | **DEFAULT** | Specifies an initial value (which may be overridden). | | //default// | A string constant containing the initial value. | | **ICON** | Specifies an icon for the button face of a #PROMPT with the MULTI attribute. | | //file// | A string constant containing the name of the .ICO file to display on the button face. | | **AT** | Specifies the position of the prompt entry area in the window, relative to the first prompt placed on the window from the Template (excluding the standard prompts on every procedure properties window). This attribute takes the same parameters as the Clarion language AT attribute. | | **PROMPTAT** | Specifies the position of the prompt //string// in the window, relative to the first prompt placed on the window from the Template (excluding the standard prompts on every procedure properties window). This attribute takes the same parameters as the Clarion language AT attribute. | | **MULTI** | Specifies the programmer may enter multiple values for the #PROMPT. The prompt appears as a button which pops up a list box allowing the programmer to enter multiple values, unless the INLINE attribute is also present. | | //description// | A string constant containing the name to display on the button face and at the top of the list of prompt values. | | **UNIQUE** | The multiple values the programmer enters for the #PROMPT are unique values and are sorted in ascending order. The MULTI attribute must also be present. | | **INLINE** | The multiple values the programmer enters for the #PROMPT appears as a list box with update buttons which allow the programmer to enter multiple values. The MULTI attribute must also be present. | | **VALUE** | Specifies the value assigned to the //symbol// when the #PROMPT is selected. Valid only when the #PROMPT //type// is RADIO. | | //value// | A string constant containing the value to assign to the //symbol//. | | **SELECTION** | Specifies the programmer may select multiple values for the #PROMPT from the list of choices presented by the FROM //type//. The prompt appears as a button which pops up a list box allowing the programmer to choose multiple values, unless the INLINE attribute is also present. | | **CHOICE** | Specifies the //symbol// receives the ordinal position number of the selection instead of the //string// text from a DROP or OPTION/RADIO #PROMPT set. | | **WHENACCEPTED** | Specifies an //expression// to execute when the #PROMPT posts an Accepted event (the programmer has entered or chosen data). | | //group// | The name of the #GROUP to execute. | | **HSCROLL** | Specifies horizontal scroll bars in the DROP list. Valid only when the #PROMPT //type// is DROP. | | **PROP** | Specifies a property to assign to the prompt text. //Name //designates the property name equate (Example: PROP:FontColor) and //value// is the value assigned to the named property (Example: 0FFFFFFH) | The **#PROMPT** statement asks the programmer for input. A #PROMPT statement may be placed in #APPLICATION, #PROCEDURE, #CODE, #CONTROL, #EXTENSION, #UTILITY, or #FIELD sections. It may not be placed in a #PROGRAM, #MODULE, #TEMPLATE, or #GROUP section. When the #PROMPT is placed in a template section, the prompt //string// and its associated entry field are placed as follows: | | __**Section Name**__ | __**Window Name**__ | | | #APPLICATION | Global Settings | | | #PROCEDURE | Procedure Properties | | | #CODE | Embeds Dialog | | | #CONTROL | Control Properties Actions Tab | | | #EXTENSION | Extensions Dialog | | | #FIELD | Control Properties Actions Tab | **#PROMPT Entry Types** The //type// parameter may either contain a picture token to format the programmer's input, or one of the following keywords: | [[check check box .htm|CHECK]] | Creates a check box | | [[color call color dialog .htm|COLOR]] | Calls a standard Windows Color dialog | | [[component list of key fields .htm|COMPONENT]] | The label of a key component field (can be limited to one key) | | [[control list of window fields .htm|CONTROL]] | A window control | | [[drop droplist of items .htm|DROP]] | Creates a drop list of items specified in its parameter | | [[edit single line text box .htm|EDIT]] | Creates a TEXT control with optional size parameter | | [[embed enter embedded source .htm|EMBED]] | Allows the user to edit a specified embedded source code point | | [[expr appended data fields .htm|EXPR]] | A multi-field selection box that builds an expression | | [[field list of data fields .htm|FIELD]] | The label of a file field (can be limited to one file) | | [[file list of files .htm|FILE]] | The label of a data file | | [[fontdialog return chosen font .htm|FONTDIALOG]] | Calls a standard Windows Font dialog | | [[format call listbox formatter .htm|FORMAT]] | Calls the List Box Formatter. | | [[from list of symbol values .htm|FROM]] | Creates a drop list of items contained in its symbol parameter | | [[icon call icon selection dialog .htm|ICON]] | Calls a standard Windows Open File dialog, filtered for ICON file selection | | [[key list of keys .htm|KEY]] | The label of a key (can be limited to one file) | | [[keycode list of keycodes .htm|KEYCODE]] | A keycode or keycode EQUATE | | [[opendialog call open file dialog .htm|OPENDIALOG]] | Calls a standard Windows Open File dialog | | [[optfield optional text or data field .htm|OPTFIELD]] | Constant text or the label of a file field | | [[option display radio buttons .htm|OPTION]] | Creates a radio button structure | | [[picture call picture formatter .htm|PICTURE]] | Calls the picture token formatter. | | [[procedure add to logical procedure tree .htm|PROCEDURE]] | The label of a procedure | | [[radio one radio button .htm|RADIO]] | Creates a radio button | | [[savedialog call save file dialog .htm|SAVEDIALOG]] | Calls a standard Windows Save File dialog | | [[spin spin box .htm|SPIN]] | Creates a spin control | | [[text text box .htm|TEXT]] | Creates a text entry control | For all //types// except RADIO and CHECK (and MULTI attribute prompts), the #PROMPT //string// is displayed on the screen immediately to the left of its data input area. A #PROMPT with the REQ attribute cannot be left blank or zero; it is a required input field. The DEFAULT attribute may be used to provide the programmer with an initial //value// in the #PROMPT, which may be overridden at design time. A #PROMPT with a RADIO //type// creates one Radio button for the immediately preceding #PROMPT with an OPTION //type//. There may be multiple RADIOs for one OPTION. Each RADIO's //string//, when selected, is placed in the closest preceding OPTION's //symbol//. The OPTION structure is terminated by the first #PROMPT following it that is not a RADIO. The MULTI attribute specifies the programmer may enter multiple values for the #PROMPT. A button appears on the Properties window with the //description// on its face. Alternatively, this can have an ICON attribute to name an .ICO file to display on the button face. This button calls a window containing a list box to display all the multiple values entered for the #PROMPT, along with Insert, Change, and Delete buttons. These three buttons call another window containing the #PROMPT //string// and its data entry field to allow the programmer to update the entries in the list. The EDIT attribute creates 3 controls on the dialog window; a prompt with text of the #PROMPT //string// ,a single line TEXT control, and a button on the right of the TEXT control. When the programmer has entered a value for the #PROMPT, the input value is assigned to the //symbol//. The value entered by the programmer may be checked for validity by one or more #VALIDATE statements immediately following the #PROMPT statement. The value(s) placed in the //symbol// may be used or evaluated elsewhere within the Template. A //symbol// defined by a #PROMPT in the #APPLICATION section of the Template is Global, it can be used or evaluated anywhere in the Template. A //symbol// defined by #PROMPT in a #PROCEDURE section is Local, and is a dependent symbol to %Procedure; it can be used or evaluated only within that #PROCEDURE section. A //symbol// defined by #PROMPT in a #CODE, #CONTROL, or #EXTENSION section of the Template can be used or evaluated only within that section. **Example:** **#PROMPT****('Ask for Input',@s20),%InputSymbol        #!Simple input** **#PROMPT****('Ask for FileName',FILE),%InputFile,REQ   #!Required filename** **#PROMPT****('Pick One',OPTION),%InputChoice           #!Mutually exclusive options** **#PROMPT****('Choice One',RADIO)** **#PROMPT****('Choice Two',RADIO)** **#PROMPT****('Next Procedure',PROCEDURE),%NextProc     #!Prompt for procedure name** **                                                  #!Prompt for multiple input:** **#PROMPT****('Ask for Multiple Input',@s20),%MultiSymbol,MULTI('Input Values...')** **#PROMPT****('ABC Version',@S10),%ABCVersion,DEFAULT('6000'),PROP(PROP:READONLY,1) #!Display only** **See Also:**     [[ display display only prompt .htm|#DISPLAY]] ,[[ validate validate prompt input .htm|#VALIDATE]] ,[[ group reusable statement group .htm|#GROUP]] ,[[ boxed prompt group box .htm|#BOXED]] ,[[ enable enable disable prompts .htm|#ENABLE]] ,[[ button call another page of prompts .htm|#BUTTON]] ,[[ declare declare a user defined symbol .htm|#DECLARE]] ,[[ equate declare and assign value to a user defined symbol .htm|#EQUATE]]