PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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 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 the 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 the 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 the WEBDEV sites in Windows.
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.
    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 Input is called, 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 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 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.
    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 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 requested value. Therefore, <Parameter 1> will replace %1.
<Parameter N>: 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.
    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 Input is called, 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.
    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 Input is called, 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.
    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 Input is called, 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 the dialog box corresponds to the title of the current window (or page).
    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.
  • WINDEVAndroidiPhone/iPadJava To modify the characteristics of the edit control (e.g. to modify the alignment or to replace the characters typed in the control with asterisks), display the question edit wizard ( Input in the syntax of Input) and click 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. 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, WEBDEV 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 options of WINDEV/WEBDEV/WINDEV Mobile:
  • On the "Home" pane, in the "Environment" group, expand "Options" and select "General options of WINDEV/WEBDEV/WINDEV Mobile".
  • Display the "Directory" tab.
See wizard for typing a question for more details.
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 of orientation" of the window.
    • in the event "Placing in foreground" associated with the project.
      Note: However, the function can be used in the event "Placing in 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 event "Initializing" 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 event "Initializing" 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 event "Initializing" 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):
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
Component : wd240obj.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Video Input Webdev
https://youtu.be/omAQf0idVeA

https://windevdesenvolvimento.blogspot.com/2019/07/dicas-2201-windev-webdev-mobile-dicas.html
//
DIGITE_EMAIL IS STRING=""
INPUT("DIGITE EMAIL:",DIGITE_EMAIL)
amarildo
16 Jul. 2019
Examples
IF RADIO_T007_TIPO_TELEFONE = "C" THEN
EDT_T007_TELEFONE..InputMask = "(99)99999-9999"
EDT_T007_TELEFONE..Caption = "Celular"
END

IF RADIO_T007_TIPO_TELEFONE = "R" OR RADIO_T007_TIPO_TELEFONE = "B" THEN
EDT_T007_TELEFONE..InputMask = "(99)9999-9999"
EDT_T007_TELEFONE..Caption = "Residencial"
END

IF RADIO_T007_TIPO_TELEFONE = "B" THEN
EDT_T007_TELEFONE..InputMask = "(99)9999-9999"
EDT_T007_TELEFONE..Caption = "Comercial"
END
BOLLER
02 Apr. 2019
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
15 Jan. 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
14 Jul. 2016