PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Displays a message allowing the user to type an information.
Dialog function
Note: Several syntaxes are available for this function:
  • Simplified syntax, entered in the code editor directly.
  • Full syntax with the question typed 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 the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 20 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 20
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Example
// Example of simplified input
NbCopies is int
ReturnValue is int
ReturnValue = Input("How many copies do you want to print?", NbCopies)
SWITCH ReturnValue
CASE 0: Info("You canceled. The default number is set to 1.")
CASE 1: Info("You requested " + NbCopies)
END
// Simplified input while using an input mask
PhoneNum is string
// Use a specific text input mask
Input.InputMask = maskPhoneFrance
SWITCH Input("What is your phone number?", PhoneNum)
// OK
CASE 1: EDT_PhoneNum = PhoneNum
// Cancel
CASE 0: EDT_PhoneNum = "No phone"
END
Comments is string
Comments = RepeatString(CR, 10)
// Comments typed by the user in a multiline control
// Input limited to 140 characters
Input.InputMask = "regexp:.{0,140}"
SWITCH Input("Type your comments.", Comments)
// OK
CASE 1: EDT_Comment = Comments
// Cancel
CASE 0: EDT_Comment = "No comment"
END
DisplayInfo is boolean = False
// Ask the user whether he really wants to close the application
// A checkmark ("Don't display this window anymore") allows the user
// not to display this question anymore
Input.OptionalCaption = "Don't display this window anymore"
IF DisplayInfo = False THEN
SWITCH Input("Do you want to close the application?", DisplayInfo)
// Close
CASE 1: Close()
END
END
// Remember to store the value of DisplayInfo for the next time
Versions 20 and later
// Direct syntax
PhoneNum is string
IF Input("What is your phone number?", PhoneNum, ...
["Validate", "No phone", "Cancel"], 3, 3, dlgIconQuestion) = 1 THEN
Info(PhoneNum)
END
New in version 20
// Direct syntax
PhoneNum is string
IF Input("What is your phone number?", PhoneNum, ...
["Validate", "No phone", "Cancel"], 3, 3, dlgIconQuestion) = 1 THEN
Info(PhoneNum)
END
// Direct syntax
PhoneNum is string
IF Input("What is your phone number?", PhoneNum, ...
["Validate", "No phone", "Cancel"], 3, 3, dlgIconQuestion) = 1 THEN
Info(PhoneNum)
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 (with quotes)
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 the Time or Date variables, the input mask is automatically deduced from the variable. 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 the call to Input, this variable contains the user's answer (regardless of the button clicked).

Full syntax with the question typed via a wizard Hide the details

<Result> = Input(<Question>, <Variable to Enter> [, <Parameter 1> [, <Parameter 2>, ...]])
<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 found in the description window of the question. The different values corresponding to the different answers are automatically included in comments in the code editor when selecting the message.
<Question>: Character string (with quotes)
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 the Time or Date variables, the input mask is automatically deduced from the variable. 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 the call to Input, 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 requested value. Therefore, <Parameter 1> will replace %1.
<Parameter 2>: Character string
If the selected message contains configurable elements (identified by %1, %2, ...), this parameter is used to give the requested 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 (with quotes)
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 the Time or Date variables, the input mask is automatically deduced from the variable. 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 the call to Input, this variable contains the user's answer (regardless of the button clicked).
<Captions of Buttons>: Array
Name of Array variable containing the captions of buttons.
<Default Button>: Integer
Subscript of 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 (with quotes) 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 (with quotes)
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 the Time or Date variables, the input mask is automatically deduced from the variable. 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 the call to Input, this variable contains the user's answer (regardless of the button clicked).
<Captions of Buttons>: Array
Name of Array variable containing the captions of buttons.
<Default Button>: Integer
Subscript of 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 (with quotes) 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 (with quotes)
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 the Time or Date variables, the input mask is automatically deduced from the variable. 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 the call to Input, this variable contains the user's answer (regardless of the button clicked).
<Captions of Buttons>: Array
Name of Array variable containing the captions of buttons.
<Default Button>: Integer
Subscript of 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 (with quotes) 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 dialog box corresponds to the title of current window.
    iPhone/iPad To comply with the system specifications, the title of dialog box is empty by default. To define this title, use NextTitle. 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.
  • To modify the characteristics of edit control (to modify the alignment or to replace the characters typed in the control by asterisks for example), display the wizard for editing the question ( Input in the syntax of Input) and click Editing the parameters of Input.

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. See 2510033 for more details.

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 and WINDEV Mobile.
This directory can be modified in the WINDEV options ("Tools .. Options .. General options of WINDEV", "Directory" tab).This directory can be modified in the WINDEV options:
  • on the "Home" pane, in the "Environment" group, expand "Options" and select "General options of WINDEV".
  • display the "Directory" tab.
See wizard for typing a question for more details.
AndroidiPhone/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 process for resizing windows. Otherwise, the application will be locked.
    • in the process for changing the orientation of windows.
    • in the "Move to the foreground" process associated with the project.
      Note: However, the function can be used in the "Move to the foreground" process of a window.
    • in a thread.

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):
Recipient is string
//1: Create a follow-up
//0: Don't create a follow-up
//1: OK
SWITCH Input("Specify a recipient.", Recipient)
// Validate the recipient
CASE 1

// Display the list
CASE 2

// Cancel
CASE 3

END
Components
WINDEVReports and Queries wd230obj.dll
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 10
This page is also available for…
Comments
Exemplo Mascara Input
Input.InputMask=empresa_parametro.casas_mascara_quantidade

Input("Digite Quantidade:",_quantidade_nota)

// Blog com video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2018/01/aula-1357-de-1631-videos-windev-dicas.html

https://www.youtube.com/watch?v=KDnpqox7gu0

De matos
Jan. 15 2018
Exemplo Input
Exemplo Input

n_numero_copias is int
Input("Quantas Copias",n_numero_copias)
s_telefone is string=""
Input.InputMask=maskPhone
Input("Telefone",s_telefone)
s_observacao is string=""
s_observacao=RepeatString(CR,10)
Input.InputMask="regexp:.{0,140}"
Input("Observacao",s_observacao)
b_pergunta is boolean=False
Input.OptionalCaption="Deseja Gravar"
Input("pergunta",b_pergunta)

//blog com Video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/07/curso-windev-funcoes-dialogo-6-input.html
https://www.youtube.com/watch?v=FQisG32jR74
De matos AMARILDO
Jul. 14 2016