OT FindInArray (inObject; inTag; inValue {; inStart}) Longint
→
Parameter Type Description
inObject Longint inTag String inValue Text inStart Number Function result Number A handle to an object
→ Tag of the array item to change
- Value to search for
- Element at which to start search
- The index of the first element found ←
Discussion
OT FindInArray searches an array in inObject for the value inValue.
If inObject is not a valid object handle, if no item in the object has the given tag, or if the item’s type is not an array type, an error is generated, OK is set to zero, and -1 is returned.
If inStart is not specified or is zero, it defaults to 1. The text inValue is converted to the type appropriate for the array being searched. For example, for a Longint array or Real array, inValue is converted as if it where passed to the 4D Num command. The formats used to convert values are as follows:
Array type Example inValue
| Boolean array | "true" or "1" = true, "false" or "0" = false |
| Date array | String(!08/27/31!) |
| Longint array | String(7) |
| Real array | String(13.27) |
The result of the command is the index of the first matching element, or -1 if no match is found.
Note Wildcards may be used when searching string/text arrays just as in 4D.

