Ir al contenido principal

Atributos de eventos en memoria

Estructura

Tipo «EventEventAttributesInMemory

»

Procedimiento

Descripción

Llama a esta función al final de una sección del código del script de eventos en la que se vayan a ejecutar varias funciones LookupEventAttribute* y/o SetEventAttribute* para acelerar estas operaciones. Esta función siempre va acompañada de una llamada a BeginEventAttributesInMemory, que se coloca antes de las funciones LookupEventAttribute\* y/o SetEventAttribute\* que se van a optimizar.

Cuando se invoca a BeginEventAttributesInMemory, todos los datos de los atributos del evento actual se cargan en memoria y se guarda el estado actual. A partir de ese momento, cualquier llamada posterior a las funciones LookupEventAttribute* o SetEventAttribute* leerá o escribirá en la memoria, en lugar de hacerlo en la base de datos. Cuando se invoca a EndEventAttributesInMemory, se compara el estado actual de los atributos en memoria con el estado anterior; a continuación, se envían las actualizaciones (en un único lote) a la base de datos y se envía una instrucción a la interfaz de usuario para que actualice la visualización.

Parámetros = ninguno Ejemplo de

BeginEventAttributesInMemory

ShowMessage(
"BOOLEAN ATT = " & LookupEventAttributeBoolean("BOOLEAN ATT") & Chr(13) &
"DATE ATT = " & LookupEventAttributeDate("DATE ATT") & Chr(13) &
"DEPARTMENT ATT = " & LookupEventAttributeText("DEPARTMENT ATT") & Chr(13) &
"MEMO ATT = " & LookupEventAttributeMemoAsText("MEMO ATT") & Chr(13) &
"NUMERIC ATT = " & LookupEventAttributeNumeric("NUMERIC ATT") & Chr(13) &
"TEXT ATT = " & LookupEventAttributeText("TEXT ATT") & Chr(13) &
"TIME ATT = " & LookupEventAttributeTime("TIME ATT"))

SetEventAttributeBoolean("BOOLEAN ATT", True)
SetEventAttributeDate("DATE ATT", LookupEventFieldNumeric("EVENT_DATE"))
SetEventAttributeText("DEPARTMENT ATT", "DEPT 1")
SetEventAttributeMemoAsText("MEMO ATT", "Test Memo" & Chr(13) & "Line 2 here")
SetEventAttributeNumeric("NUMERIC ATT", 12.45)
SetEventAttributeText("TEXT ATT", "TEXTO DE PRUEBA AQUÍ")
SetEventAttributeTime("TIME ATT", LookupEventFieldNumeric("EVENT_TIME"))

EndEventAttributesInMemory |