Condividi tramite


BeforeCursorFill Event

Occurs immediately before a CursorAdapter object attempts to attach a new cursor.

PROCEDURE Object.BeforeCursorFill 
LPARAMETERS lUseCursorSchema, lNoDataOnLoad, cSelectCmd

Parameters

  • lUseCursorSchema
    Specifies the value of the lUseCursorSchema parameter from the CursorFill method.
  • lNoDataOnLoad
    Specifies the value of the lNoData property in CursorFill.
  • cSelectCmd
    Specifies the current value of the SelectCmd property. You can change the value of the cSelectCmd parameter in this event. However, the value in the SelectCmd property does not change. If you change the value of the cSelectCmd parameter in this event, Visual FoxPro uses the changed value of cSelectCmd.

Remarks

Applies To: CursorAdapter Class

Visual FoxPro stores the value changes, which are used by CursorFill. The CursorRefresh method uses the value of the SelectCmd parameter, not the SelectCmd property. This facilitates construction of custom queries "on the fly". For example, you can store a basic SELECT – SQL command in the SelectCmd property and add a WHERE clause to the SelectCmd parameter in this event without changing the underlying value of the property. The value of the SelectCmd parameter is then passed to the AfterCursorFill event.

If the code in BeforeCursorFill returns a value of False (.F.), CursorFill does not execute, and the currently attached cursor remains unclosed. However, if the code in BeforeCursorFill does not return false, the currently attached cursor closes, and CursorFill executes.

Changes made to these parameters take precedence over the original values stored in the respective properties or that are passed to CursorFill.

See Also

Reference

CursorAdapter Object Properties, Methods, and Events
CursorFill Method
SelectCmd Property
CursorRefresh Method
SelectCmd Property
SELECT - SQL Command
AfterCursorFill Event

Other Resources

Events (Visual FoxPro)