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
  • Features of the dialog box
  • Line break in the dialog box
  • Displaying the last error message
  • Miscellaneous
  • 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 custom error message in a system error window for a set amount of time. After the timeout, the system window is automatically closed.
Remarks:
  • This warning window blocks the application until the time limit has elapsed. To continue running the application, the user must click "OK".
    WINDEVAndroid To avoid blocking the application, use ErrorWithTimeoutAsynchronous.
  • WINDEV WINDEV allows you to apply the skin template of your project to this dialog box. For more details, see Customizing dialog boxes.
Ejemplo
// Display "An error was detected" in an error window
// This error window will be automatically closed after 10 seconds.
ErrorWithTimeout(1000, "An error was detected")
// Display the last error in an error window 
// This error window will be automatically closed after 5 seconds.
ErrorWithTimeout(500)
Sintaxis

Displaying a custom error message Ocultar los detalles

ErrorWithTimeout(<Timeout> , <Text> [, <Line 2> [... [, <Line n>]]])
<Timeout>: Integer or Duration
Amount of time (expressed in hundredth of second) before automatically closing the error window. This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).
<Text>: Character string
Text to display.
<Line 2>: Optional character string
Text displayed on the second line.
<Line n>: Optional character string
Text displayed on the Nth line.

Displaying the error message of the last WLanguage function used Ocultar los detalles

ErrorWithTimeout(<Timeout before closing>)
<Timeout before closing>: Integer or Duration
Amount of time (expressed in hundredth of second) before automatically closing the error window. This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).
Observaciones

Features of the dialog box

  • The title of the dialog box is the title of the current window. To modify this title, use NextTitle.
  • The message is aligned to the left.
  • The button caption depends on the runtime language of Windows.
  • The maximum number of characters cannot exceed 4096. If a larger string is passed as parameter, it will be truncated.
  • The icon displayed (white cross) cannot be modified.
To customize this dialog box (and all the system dialog boxes in your application), check "Personalizar ventanas del sistema (Info, YesNo, Confirm, Dialog)" in the "Style" tab of the project description. For more details, see Customizing dialog boxes.

Line break in the dialog box

The CR string (Carriage Return) can be used to force a break to the next line. For example:
ErrorWithTimeout(500, "An error was detected while entering the address." + CR + ...
	"Please modify the customer details.")
is equivalent to:
ErrorWithTimeout(500, "An error has been detected when entering the address." , ...
	"Please modify the customer details.")
You also have the ability to use the syntax of multiline strings. For example:
ErrorWithTimeout(500,
[
An error was detected while entering the address. 

Please modify the customer details.
])

Displaying the last error message

Calling ErrorWithTimeout by specifying only the timeout (syntax2), displays the error message of the last WLanguage function that triggered an error.
In this case, the following code:
ErrorWithTimeout(500)
is equivalent to:
ErrorWithTimeout(500, ErrorInfo())
Caution: The ErrorWithTimeout function must be used immediately after calling the failed function.. Indeed, calling a WLanguage function may reinitialize and modify the status report of ErrorWithTimeout.

Miscellaneous

  • Timers (TimerSys) are not stopped when this function is called.
  • Windows events are not stopped when this function is called.
  • The caption of the button is displayed in the language used by Windows on the current computer.
  • Equivalence: The ErrorWithTimeout is equivalent to function Error used with function DelayBeforeClosing.
    The following code:
    ErrorWithTimeout(1000, "An error was detected")
    is equivalent to:
    DelayBeforeClosing(1000)
    Error("An error occurred")
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 ErrorWithTimeout 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 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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