Pular para o conteúdo principal

BeginEventAttributesInMemory

Structure

BeginEventAttributesInMemory

Type

Procedure

Description

Call this function at the beginning of a section of event script code that will be performing multiple LookupEventAttribute* and/or SetEventAttribute* functions - to speed up these operations. This function is always coupled with a call to EndEventAttributesInMemory that is placed after the LookupEventAttribute* and/or SetEventAttribute* functions being optimized.

When BeginEventAttributesInMemory is called, all the event attribute data for the current event is fetched into memory, and the current state is memorized. Then, any subsequent calls to LookupEventAttribute* or SetEventAttribute* functions will read/write to memory, rather than to the database. When EndEventAttributesInMemory is called, the current state of the attributes in memory is compared to the previous state, then any updates are sent (in a single batch) to the database, and an instruction is passed to the user interface to update display.

Parameters = none

Example

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", "TEST TEXT HERE")
SetEventAttributeTime("TIME ATT", LookupEventFieldNumeric("EVENT_TIME"))

EndEventAttributesInMemory |