#PROMPT (prompt for programmer input) 

Top  Previous  Next

 

 

#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 ) ]

#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

Creates a check box

COLOR

Calls a standard Windows Color dialog

COMPONENT

The label of a key component field (can be limited to one key)

CONTROL

A window control

DROP

Creates a drop list of items specified in its parameter

EDIT

Creates a TEXT control with optional size parameter

EMBED

Allows the user to edit a specified embedded source code point

EXPR

A multi-field selection box that builds an expression

FIELD

The label of a file field (can be limited to one file)

FILE

The label of a data file

FONTDIALOG

Calls a standard Windows Font dialog

FORMAT

Calls the List Box Formatter.

FROM

Creates a drop list of items contained in its symbol parameter

ICON

Calls a standard Windows Open File dialog, filtered for ICON file selection

KEY

The label of a key (can be limited to one file)

KEYCODE

A keycode or keycode EQUATE

OPENDIALOG

Calls a standard Windows Open File dialog

OPTFIELD

Constant text or the label of a file field

OPTION

Creates a radio button structure

PICTURE

Calls the picture token formatter.

PROCEDURE

The label of a procedure

RADIO

Creates a radio button

SAVEDIALOG

Calls a standard Windows Save File dialog

SPIN

Creates a spin control

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 ,#VALIDATE ,#GROUP ,#BOXED ,#ENABLE ,#BUTTON ,#DECLARE ,#EQUATE