AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones de cuadros de diálogo
  • Characteristics of dialog box and edit control
  • Managing input masks
  • Typing multiline text
  • Input performed via a check box
  • Message database
  • Limitations
  • Example of full input
  • Aplicación en segundo plano: Caso concreto de Android 10
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Displays a message allowing the user to type an information.
Input
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.
Ejemplo
// 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 have cancelled. The default number is 1.")
	CASE 1: Info("You have requested " + nbExemplaire)
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: SAI_NumTel = NumTel 
	// Cancel
	CASE 0: SAI_NumTel = "No telephone".
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: SAI_Comment = Comments
	// Cancel
	CASE 0: SAI_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: Farm()
	END
END
// Remember to store the value of DisplayInfo for the next time
// 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
Sintaxis

Simplified syntax (without using the wizard) Ocultar los detalles

<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.
    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 entered via a wizard Ocultar los detalles

<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.
    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 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 Ocultar los detalles

<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.
    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 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:
    dlgIconErrorIcon representing an error.
    dlgIconInfoIcon representing an information.
    dlgIconQuestion
    (Default value)
    Icon representing a question.
Observaciones

Characteristics of dialog box and edit control

  • El título del cuadro de diálogo corresponde al título de la ventana (o página) actual.
    AndroidiPhone/iPad Para cumplir con las especificaciones del sistema, el título del cuadro de diálogo está vacío. Para definir el título, utilice la función NextTitle.
  • Para modificar o definir el título del cuadro de diálogo, utilice la función 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
maskAlphaNumLetters + digits
maskAlphaNumUpperLetters in uppercase characters + digits
maskAlphaUpperLetters in uppercase characters
maskEmailEmail address
maskFileNameFile name and path
maskFileNoFolderFile name (without its directories)
maskFileSizeNumeric mask for file and disk sizes
maskFUpperFirst letter in uppercase
maskINSEEINSEE number
maskINSEEKeyINSEE number + key
maskLowerAll in lowercase letters
maskNoneNo input mask
maskNumDigits
maskNumPlusDigits, '+', ' ', '.', '-', ','
maskPatronymicLetters + Digits + Space + Apostrophe + Dash
maskPatronymicUpperCaps + Digits + Space + Quote + Dash
maskPhonePhone number
maskPhoneFrancePhone number in French format
maskUpperAll in uppercase letters

You also have the assign a regular expression as input mask. For more details, see the help on the InputMask (Property) 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 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 "Inicio" tab, in the "Entorno" group, expand "Opciones" and select "WINDEV/WEBDEV/WINDEV Mobile general options".
  • Display the "Directory" tab.
For more details, see question edit wizard.
WEBDEV - Código ServidorAndroidiPhone/iPadJava

Limitations

  • 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 "Resize" event of the window. Otherwise, the application will be locked.
    • in the "Change the orientation" event of the window.
    • in the "Move to the foreground" event associated with the project.
      Note: The function can also be used in the "Bring to foreground" event of a window..
    • in a thread.
  • WEBDEV - Código Servidor Special cases:
    • If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event.
    • 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 reminder
//0: Don't create a dungeon
//1: OK 
SWITCH Input("Specify a recipient.", Recipient)
	// Validate the recipient
	CASE 1

	// Display the list
	CASE 2

	// Cancel
	CASE 3

END
Android

Aplicación en segundo plano: Caso concreto de Android 10

A partir de Android 10, no se puede abrir una ventana si la aplicación está en segundo plano.
La función Input puede abrir una ventana. Si se utiliza esta función cuando la aplicación está en segundo plano, se producirá un error fatal.
Consejos:
  • Para saber si la aplicación está en segundo plano, utilice la función InBackgroundMode.
  • Si una aplicación necesita interactuar con el usuario cuando está en segundo plano, se puede mostrar una notificación (con el tipo Notification). La aplicación volverá al primer plano cuando se haga clic en la notificación, si la propiedad ActivateApplication se establece en True. También es posible abrir una ventana desde el procedimiento pasado a la propiedad ActionClick.
Para obtener más información, consulte Android 10: Comportamiento de las aplicaciones en segundo plano.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
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 07 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 04 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 01 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 07 2016

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local