version 1.5
OD Activate context (login_ID; context_ID{; preload}) Integer
| Parameter | Type | Description | |
| login_ID | Longint | Connection identifier | |
| context_ID | Longint | Context identifier | |
| preload | Longint | 1 = preload; 0 = no preload | |
| Function result | Integer | Error code | |
| 1 = the operation is successful | |||
| -1 = an error occurs |
Description
The OD Activate context function activates a context created by OD Create context, OD Create context dialog, or by loading a picture or file containing the context definition.
login_ID must be a valid connection identifier. context_ID must be a previously created and inactive context identifier.
preload is an optional parameter. If you know that the user will make extensive browsing inside the context or will use the OD Find in context function, you should specify preload to equal 1. OD Activate context will be a bit slower but subsequent operations will be faster.
If preload equals 1, 4D for Oracle will immediately load its internal array of keys that are used by direct access functions, like OD Goto in context or OD Previous in context and OD Find in context.
If preload equals 0 or if you didn't specify a value, the keys will be loaded as they are needed (i.e., when you call the functions that need them).
OD Activate context creates a cursor and defines the set of rows that correspond to the result of the query. OD Activate context does not retrieve any result rows. To display result rows, you must use OD Next in context and OD Previous in context. You can use OD Next in context to retrieve the first row of the results.
As long as the context is active, you cannot modify its definition using OD ADD TO CONTEXT, OD EDIT CLAUSES IN CONTEXT or OD SET CLAUSE IN CONTEXT. A context remains active until you deactivate it by calling OD DEACTIVATE CONTEXT.
OD Activate context returns -1 if an error occurs. Otherwise it returns 1. If an error occurs, you can use OD Last error to retrieve an explanation of the error.
See Also
OD Create context, OD DEACTIVATE CONTEXT, OD Last error, OD Next in context, OD Previous in context.