<OBJECT>.FIND()

Syntax

Result as C = <OBJECT>.FIND( [ Value as A ] )

<OBJECT>.FIND( [ Integer _ Value as N ] )

Argument

Description

Result

  • "ExactMatch" = the method was able to find an exact match for the key you were searching for.

  • "ClosestMatch" = method found the closest match for the key you were searching for

Value

A Character, Numeric, Logical, or Date key value to find. Optional. Default = "" displays the Find by Key dialog.

Integer _ Value

The number of a record.

Description

The <OBJECT>.FIND() method applies to:

The <OBJECT>.FIND() method displays the first record whose key value matches Value. If value is not specified, the built-in Find by Key dialog is displayed. You must examine the contents of the record to determine if it is the one you seek.

The search key is determined by the current sort order. You may want to use the <FORM>.INDEX_SET() or the <FORM>.QUICK_SORT() method first to set the sort order of the table.

Supported By

Alpha Five Version 5 and Above

Limitations

Desktop applications only.

Example

This script is attached to a button. It sets the primary index to "Last_Name", then finds the record for "McMillan":

parentform.index_set("Last_Name")

parentform.find("mcmillan")

A form has a variable called "What_Name" and a button called "Find". When the user presses the button, the script searches for the name entered into "What_Name".

parentform.index_set("Last_Name")

parentform.find(what_name.value)

A form has two variables: "What_Value" and "Find_by". "Find_by" is a radio button with these choices: "Last name", "Company" and "Phone". The form also has a button called "Find". When the user presses the button, the script searches for the value in "What_Value" using the index selected by the radio button.

SELECT

  CASE find_by.value = "Last_name"

        parentform.index_set("Last_Name")

  CASE find_by.value = "Company"

        parentform.index_set("Company")

  CASE find_by.value = "Phone"

        parentform.index_set("Phone")

end SELECT

parentform.commit()

parentform.find(what_value.value)

See Also

Form Functions and Methods, Browse Functions and Methods