BeforeCursorAttach Event

JavaScript Editor js editor     Web development 



Main Page

Occurs immediately before the CursorAdapter object attempts to attach a cursor. You can use this event to perform any necessary operations before attaching the cursor or table, determine an alias to attach, and so on.

PROCEDURE Object.BeforeCursorAttach 
LPARAMETERS cAlias

Parameters

cAlias


Specifies the alias of the cursor or table being attached.

Remarks

Applies To: CursorAdapter Class

If the code in BeforeCursorAttach returns a value of False (.F.), the cursor attachment does not occur.

Note:
The CursorAdapter object respects any changes that might be made to the cAlias parameter by BeforeCursorAttach.

Example

The following example illustrates how to open a local view in BeforeCursorAttach so that you can attach the view to a CursorAdapter object:

В Copy Code
PROCEDURE BeforeCursorAttach
OPEN DATABASE HOME(2)+"tastrade\data\tastrade.dbc"
USE 'product listing'
ENDPROC

Then make the following call to attach the view:

В Copy Code
CursorAttach('product listing', .T.)

See Also



JavaScript Editor js editor     Web development