VP FLUSH COMMANDS
Historia
Lanzamiento | Modificaciones |
---|---|
20 R9 | Soporte del parámetro callback |
VP FLUSH COMMANDS ( vpAreaName : Text {; callback : 4D.Function} )
Parámetros | Tipo | Descripción | |
---|---|---|---|
vpAreaName | Text | -> | Nombre de objeto formulario área 4D View Pro |
retrollamada | 4D.Function | -> | (Optional) A callback function executed after all VP commands and 4D custom functions have been executed |
Descripción
El comando VP FLUSH COMMANDS
ejecuta inmediatamente los comandos almacenados y borra el buffer de comandos.
En vpAreaName, pase el nombre del área 4D View Pro. Si pasa un nombre que no existe, se devuelve un error.
Para aumentar el rendimiento y reducir el número de peticiones enviadas, los comandos 4D View Pro llamados por el desarrollador se almacenan en un buffer de comandos. Cuando se llama, VP FLUSH COMMANDS
ejecuta los comandos como un lote al salir del método y vacía el contenido del buffer de comandos.
If a callback function is provided, it is only executed after all stored commands and 4D custom functions have finished processing. This ensures that any follow-up actions, such as saving or printing the document, are only performed after all calculations have completed.
The following parameters can be used in the callback function:
Parámetros | Tipo | Descripción | |
---|---|---|---|
param1 | Text | El nombre del objeto de área 4D View Pro | |
param2 | Object | Un objeto devuelto por el método con un mensaje de estado | |
.success | Boolean | True si la importación se ha realizado correctamente, False en caso contrario | |
.errorCode | Integer | Código de error | |
.errorMessage | Text | Mensaje de error |
Ejemplo 1
You want to execute commands and empty the command buffer:
// Definir valores de texto en celdas específicas
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;1); "INVOICE")
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;2);"Invoice date: ")
VP SET TEXT VALUE(VP Cell("ViewProArea1";10;3);"Due date: ")
// Ejecutar los comandos almacenados, borrar la memoria intermedia y activar la llamada de retorno
VP FLUSH COMMANDS("ViewProArea1")
Ejemplo 2
Desea ejecutar comandos, vaciar el búfer de comandos y activar una función de retrollamada:
// Definir valores de texto en celdas específicas
VP SET FORMULA(VP Cell("ViewProArea1";10;1); "MyCustomFunction()")
VP SET FORMULA(VP Cell("ViewProArea1";10;2); "MyCustomFunction2()")
VP SET FORMULA(VP Cell("ViewProArea1";10;3); "MyCustomFunction3()")
// Ejecutar los comandos almacenados, borrar la memoria intermedia y activar la retrollamada
VP FLUSH COMMANDS("ViewProArea1"; Formula(onFlushComplete))
// Método 'onFlushComplete'
#DECLARE($name : Text; $status : Object)
ALERT("All commands and custom functions have finished executing. You can now print or save the document.")