PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Characteristics of dialog box and edit control
  • Managing input masks
  • Typing multiline text
  • Input performed via a check box
  • Message database
  • Limits
  • Example of full input
  • Application in the background: Specific case from Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Displays a message allowing the user to type an information.
Input
Remark: 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. The caption of the buttons is proposed according to the text of the question.
  • Versions 20 and later
    Direct syntax, typed in the code editor directly.
    New in version 20
    Direct syntax, typed in the code editor directly.
    Direct syntax, typed in the code editor directly.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 16 and later
WINDEVLinux This function is now available for WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for WINDEV applications in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Versions 20 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 20
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 24 and later
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for WEBDEV sites in Windows.
New in version 24
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for WEBDEV sites in Windows.
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for WEBDEV sites in Windows.
Example
// Exemple de saisie simplifiée
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
// Saisie simplifiée avec utilisation d'un masque de saisie
NumTel is string
// Utilisation d'un masque de saisie texte spécifique
Input.InputMask = maskPhoneFrance
SWITCH Input("Quel est votre numéro de téléphone?", NumTel)
// OK
CASE 1: SAI_NumTel = NumTel
// Annuler
CASE 0: SAI_NumTel = "Pas de téléphone"
END
Commentaires is string
Commentaires = RepeatString(CR, 10)
// Saisie de commentaires par l'utilisateur dans un champ multiligne
// Saisie limitée à 140 caractères
Input.InputMask = "regexp:.{0,140}"
SWITCH Input("Saisissez vos commentaires.", Commentaires)
// OK
CASE 1: SAI_Comment = Commentaires
// Annuler
CASE 0: SAI_Comment = "Pas de commentaire"
END
AfficherInfo is boolean = False
// On demande à l'utilisateur s'il veut réellement fermer l'application
// Une coche "Ne plus afficher cette fenêtre" permet à l'utilisateur
// de ne plus afficher cette question à l'avenir
Input.OptionalCaption = "Ne plus afficher cette fenêtre"
IF AfficherInfo = False THEN
SWITCH Input("Voulez-vous fermer l'application?", AfficherInfo)
// Fermer
CASE 1: Close()
END
END
// Pensez à stocker la valeur de AfficherInfo pour les prochaines fois
Versions 20 and later
// Syntaxe directe
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
New in version 20
// Syntaxe directe
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
// Syntaxe directe
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 "Cancel" button was clicked by the user.
  • 1: the "OK" button was clicked by the user.
<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 his answer.
  • This variable must have been declared before the call to Input.
  • The type of variable defines the type of control where the user types his answer. For Variable s of type Time or Date, the input mask is automatically derived from the Variable.
    WINDEVAndroidiPhone/iPadJava A specific input mask can be specified (especially for the Text variables) via the Input.InputMask variable (see Notes).
  • If the variable is initialized with a value, this value corresponds to the default value.
  • After using the Inputfunction, this Variable contains the user's response (regardless of which button was used).

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 his answer.
  • This variable must have been declared before the call to Input.
  • The type of variable defines the type of control where the user types his answer. For Variable s of type Time or Date, the input mask is automatically derived from the Variable.
    WINDEVAndroidiPhone/iPadJava A specific input mask can be specified (especially for the Text variables) via the Input.InputMask variable (see Notes).
  • If the variable is initialized with a value, this value corresponds to the default value.
  • After using the Inputfunction, this Variable contains the user's response (regardless of which button was used).
<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.
Versions 20 and later

Direct syntax Hide the details

<Result> = Input(<Question> , <Variable to enter> , <Captions of buttons> [, <Default button> [, <Cancelation 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 his answer.
  • This variable must have been declared before the call to Input.
  • The type of variable defines the type of control where the user types his answer. For Variable s of type Time or Date, the input mask is automatically derived from the Variable.
    WINDEVAndroidiPhone/iPadJava A specific input mask can be specified (especially for the Text variables) via the Input.InputMask variable (see Notes).
  • If the variable is initialized with a value, this value corresponds to the default value.
  • After using the Inputfunction, this Variable contains the user's response (regardless of which button was used).
<Captions of buttons>: Array
Name of Array variable containing the captions of buttons.
<Default button>: Integer
Index of the button selected by default. This parameter is set to 1 by default.
<Cancelation button>: Integer
Subscript of cancelation button. By default, this parameter corresponds to the subscript of last button.
<Icon>: Character string or Integer constant
Icon displayed. This parameter can correspond to:
  • the path of file corresponding to the displayed icon.
  • one of the following constants:
    dlgIconErrorIcon representing an error.
    dlgIconInfoIcon representing an information.
    dlgIconQuestion
    (Default value)
    Icon representing a question.
New in version 20

Direct syntax Hide the details

<Result> = Input(<Question> , <Variable to enter> , <Captions of buttons> [, <Default button> [, <Cancelation 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 his answer.
  • This variable must have been declared before the call to Input.
  • The type of variable defines the type of control where the user types his answer. For Variable s of type Time or Date, the input mask is automatically derived from the Variable.
    WINDEVAndroidiPhone/iPadJava A specific input mask can be specified (especially for the Text variables) via the Input.InputMask variable (see Notes).
  • If the variable is initialized with a value, this value corresponds to the default value.
  • After using the Inputfunction, this Variable contains the user's response (regardless of which button was used).
<Captions of buttons>: Array
Name of Array variable containing the captions of buttons.
<Default button>: Integer
Index of the button selected by default. This parameter is set to 1 by default.
<Cancelation button>: Integer
Subscript of cancelation button. By default, this parameter corresponds to the subscript of last button.
<Icon>: Character string or Integer constant
Icon displayed. This parameter can correspond to:
  • the path of file corresponding to the displayed icon.
  • one of the following constants:
    dlgIconErrorIcon representing an error.
    dlgIconInfoIcon representing an information.
    dlgIconQuestion
    (Default value)
    Icon representing a question.

Direct syntax Hide the details

<Result> = Input(<Question> , <Variable to enter> , <Captions of buttons> [, <Default button> [, <Cancelation 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 his answer.
  • This variable must have been declared before the call to Input.
  • The type of variable defines the type of control where the user types his answer. For Variable s of type Time or Date, the input mask is automatically derived from the Variable.
    WINDEVAndroidiPhone/iPadJava A specific input mask can be specified (especially for the Text variables) via the Input.InputMask variable (see Notes).
  • If the variable is initialized with a value, this value corresponds to the default value.
  • After using the Inputfunction, this Variable contains the user's response (regardless of which button was used).
<Captions of buttons>: Array
Name of Array variable containing the captions of buttons.
<Default button>: Integer
Index of the button selected by default. This parameter is set to 1 by default.
<Cancelation button>: Integer
Subscript of cancelation button. By default, this parameter corresponds to the subscript of last button.
<Icon>: Character string or Integer constant
Icon displayed. This parameter can correspond to:
  • the path of file corresponding to the displayed icon.
  • one of the following constants:
    dlgIconErrorIcon representing an error.
    dlgIconInfoIcon 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).
    AndroidiPhone/iPad To comply with the system specifications, the title of dialog box is empty by default. To define this title, use NextTitle.
  • To modify or define the title of dialog box, use NextTitle.
  • The skin template of current project is automatically applied to the dialog box.
    AndroidJava The skin template of the application is not applied to the input window.
  • WINDEVAndroidiPhone/iPadJava To change the characteristics of the edit control (for example, change the framing or replace characters entered in the field with asterisks), display the wizard for editing the question (icon Input in the Inputfunction syntax) and click on the Icon Editing the parameters of Input.
WINDEVAndroidiPhone/iPadJava

Managing input masks

By default, the input mask is automatically defined from the project information.
However, the Input.InputMask variable allows you to modify the input mask.
This variable can take one of the following values:
maskAAlphaNumLetter, then letters + digits
maskAAlphaNumUpperUppercase letter, then uppercase letters + digits
maskAlphaLetters
maskAlphaUpperLetters in uppercase characters
maskAlphaNumLetters + digits
maskAlphaNumUpperLetters in uppercase characters + digits
maskNoneNo input mask
maskEmailEmail address
maskFileNoFolderFile name (without its directories)
maskINSEEINSEE number
maskINSEEKeyINSEE number + key
maskUpperAll in uppercase characters
maskLowerAll in lowercase characters
maskFileNameFile name and path
maskNumDigits
maskNumPlusDigits, '+', ' ', '.', '-', ','
maskPatronymicLetters + Digits + Space + Quote + Dash
maskPatronymicUpperCaps + Digits + Space + Quote + Dash
maskFUpperFirst letter in uppercase character
maskFileSizeNumeric mask for the file and disk sizes
maskPhonePhone number
maskPhoneFrancePhone number in French format

You also have the assign a regular expression as input mask. For more details, see the help on the 2510033 property.

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 the new messages are automatically added to the message database.
By default, the database of messages is found in the "Personal\Messages" 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 "General options of WINDEV/WEBDEV/WINDEV Mobile".
  • Display the "Directory" tab.
For more details, see question edit wizard.
WEBDEV - Server codeAndroidiPhone/iPadJava

Limits

  • AndroidJava The skin template of the application is not applied to the input window.
  • The variable to input cannot be initialized with CR characters. The edit control will be a single-line edit control.
    iPhone/iPad No multiline edit control can be used.
  • AndroidJava If the variable is a Boolean, the input will be performed in an edit control (and not in a check box like in WINDEV).
  • AndroidJava The input mask is not supported.
  • iPhone/iPad This function must not be used:
    • in the event "Resizing" of the window. Otherwise, the application will be locked.
    • in the event "Changing the orientation" of the window.
    • in the event "Move to the foreground" associated with the project.
      Remark: However, the function can be used in the event "Move to the foreground" of a window.
    • in a thread.
  • Versions 24 and later
    WEBDEV - Server code Special cases:
    • If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. It must be used in the event "Initializing the project after connection to the site".
    • This function must not be used in a scheduled WEBDEV task.
    New in version 24
    WEBDEV - Server code Special cases:
    • If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. It must be used in the event "Initializing the project after connection to the site".
    • This function must not be used in a scheduled WEBDEV task.
    WEBDEV - Server code Special cases:
    • If your project uses pre-launched sessions, this function must not be used in the "Initializing" event of the project. It must be used in the event "Initializing the project after connection to the site".
    • This function must not be used in a scheduled WEBDEV task.

Example of full input

  1. Typing the question in the editor:
    Typing the question
  2. Code automatically generated (only the "Recipient" variable was entered in the code editor):
Destinataire is string
//1: Créer une relance
//0: Ne pas créer de relance
//1: OK
SWITCH Input("Vous devez indiquer un destinataire.", Destinataire)
// Valider le destinataire
CASE 1
 
// Afficher la liste
CASE 2
 
// Annuler
CASE 3
 
END
Versions 25 and later
Android

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
Input can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
New in version 25
Android

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
Input can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Android

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
Input can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
Business / UI classification: UI Code
Component: wd270obj.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment