System.Find - Manhunter07/MFL GitHub Wiki

Declaration

function Find(Value: System.Struct, Member): any = \built-in\

Description

The Find function in the System returns the key of a structured value member passed as argument for Value. If there is a memnber with that value, the function returns its key. If not, it returns -1 (for strings and arrays) or "" (for records).

Remarks

In order to work with strings, the argument passed to Member must be a single-character string. Otherwise, the function always returns -1.

When the function searches for a member value, the following rules apply:

  • Checks are performed using the equal operator (?=)
  • If the structure is an empty string ("") or array ([]), Find always returns -1
  • If the structure is an empty record ({}), Find always returns ""

See also