|
|
|
|
|
- Characteristics of dialog box and edit control
- Typing multiline text
- Input performed via a check box
- Message database
- Limitations
- Example of full input
Input (Function) In french: Saisie Displays a message allowing the user to type an information.
Note Several syntaxes are available for this function: - Simplified syntax, entered in the code editor directly.
- Full syntax with the question entered via a wizard. The code editor proposes a full wizard ("<Wizard>" option proposed by the assisted input). This wizard is used to define the different elements displayed in the message and to automatically generate the corresponding code. Button labels are automatically suggested according to the question text.
- Direct syntax, typed in the code editor directly.
NbExemplaire is int
RetourValeur is int
RetourValeur = Input("Combien d'exemplaires voulez-vous imprimer ?", NbExemplaire)
SWITCH RetourValeur
CASE 0 : Info("Vous avez annulé. Le nombre par défaut est de 1.")
CASE 1 : Info("Vous avez demandé " + NbExemplaire)
END
NumTel is string
Input.InputMask = maskPhoneFrance
SWITCH Input("Quel est votre numéro de téléphone ?", NumTel)
CASE 1 : SAI_NumTel = NumTel
CASE 0 : SAI_NumTel = "Pas de téléphone"
END
Commentaires is string
Commentaires = RepeatString(CR, 10)
Input.InputMask = "regexp:.{0,140}"
SWITCH Input("Saisissez vos commentaires.", Commentaires)
CASE 1 : SAI_Comment = Commentaires
CASE 0 : SAI_Comment = "Pas de commentaire"
END
AfficherInfo is boolean = False
Input.OptionalCaption = "Ne plus afficher cette fenêtre"
IF AfficherInfo = False THEN
SWITCH Input("Voulez-vous fermer l'application ?", AfficherInfo)
CASE 1 : Close()
END
END
NumTel is string
IF Input("Quel est votre numéro de téléphone?", NumTel, ...
["Valider", "Pas de téléphone", "Annuler"], 3, 3, dlgIconQuestion) = 1 THEN
Info(NumTel)
END
Syntax
Simplified syntax (without using the wizard) Hide the details
<Result> = Input(<Question> , <Variable to enter>)
<Result>: Integer Identifies the answer selected by the user: - 0: the user has clicked on the "Cancel" button.
- 1: the user has clicked on the "OK" button.
<Question>: Character string Question that will be asked to the user. This question can use StringBuild. <Variable to enter>: Any type Variable in which the user must type the answer. - This variable must have been declared before the call to Input.
- The type of variable defines the type of control where users enter the answer. For Time or Date variables, the input mask is automatically deduced from the variable.
- If the variable is initialized with a value, this value corresponds to the default value.
- After Input is called, this variable contains the user's answer (regardless of the button clicked).
Full syntax with the question entered via a wizard Hide the details
<Result> = Input(<Question> , <Variable to enter> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Integer Identifies the answer selected by the user (value from 1 to the number of buttons found in the edit window). This answer depends on the number of buttons in the question description window. The different values corresponding to the different answers are automatically included in comments in the code editor when selecting the message. <Question>: Character string Question that will be asked to the user. This question can contain parameters identified by %1, %2, ... <Variable to enter>: Any type Variable in which the user must type the answer. - This variable must have been declared before the call to Input.
- The type of variable defines the type of control where users enter the answer. For Time or Date variables, the input mask is automatically deduced from the variable.
- If the variable is initialized with a value, this value corresponds to the default value.
- After Input is called, this variable contains the user's answer (regardless of the button clicked).
<Parameter 1>: Character string If the question contains configurable elements (identified by %1, %2, ...), this parameter is used to give the desired value. Therefore, <Parameter 1> will replace %1. <Parameter N>: Character string If the selected message contains elements with parameters (identified by %1, %2, ...), this parameter is used to give the desired value. Therefore, <Parameter 2> will replace %2.
Direct syntax Hide the details
<Result> = Input(<Question> , <Variable to enter> , <Captions of buttons> [, <Default button> [, <Cancellation button> [, <Icon>]]])
<Result>: Integer Identifies the answer selected by the user. This answer depends on the selected message. <Question>: Character string Question asked to the user. <Variable to enter>: Any type Variable in which the user must type the answer. - This variable must have been declared before the call to Input.
- The type of variable defines the type of control where users enter the answer. For Time or Date variables, the input mask is automatically deduced from the variable.
- If the variable is initialized with a value, this value corresponds to the default value.
- After Input is called, this variable contains the user's answer (regardless of the button clicked).
<Captions of buttons>: Array Name of the Array variable containing the captions of the buttons. <Default button>: Integer Index of the button selected by default. This parameter is set to 1 by default. <Cancellation button>: Integer Index of the cancellation button. By default, this parameter corresponds to the index of the last button. <Icon>: Character string or Integer constant Displayed icon. This parameter can correspond to: - the path of file corresponding to the displayed icon.
- one of the following constants:
| | dlgIconError | Icon representing an error. | dlgIconInfo | Icon representing an information. | dlgIconQuestion (Default value) | Icon representing a question. |
Remarks Characteristics of dialog box and edit control - The title of the dialog box corresponds to the title of the current window (or page).
- To modify or define the title of dialog box, use NextTitle.
- The skin template of current project is automatically applied to the dialog box.
Typing multiline text The multiline input will be allowed in the associated control if <Variable to Enter> is initialized with a character string containing CR characters. Input performed via a check box The input is performed in a check box if the variable is a boolean. The caption of the check box is defined by the Input.OptionalCaption variable. Message database All new messages are automatically added to the message database. By default, the message database is in the "Personal\Message" directory of WINDEV, WEBDEV and WINDEV Mobile. This directory can be modified in the options of WINDEV/WEBDEV/WINDEV Mobile: - On the "Home" tab, in the "Environment" group, expand "Options" and select "WINDEV/WEBDEV/WINDEV Mobile general options".
- Display the "Directory" tab.
Example of full input - Typing the question in the editor:
- Code automatically generated (only the "Recipient" variable was entered in the code editor):
Destinataire is string
SWITCH Input("Vous devez indiquer un destinataire.", Destinataire)
CASE 1
CASE 2
CASE 3
END
Business / UI classification: UI Code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|