4D v14.3Find in array |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
Find in array
Find in array
The Find in array command returns the number of the first element in array that matches value. Find in array can be used with Text, String, Numeric, Date, Pointer, and Boolean arrays. The array and value parameters must be of the same type. If no match is found, Find in array returns –1. If start is specified, the command starts searching at the element number specified by start. If start is not specified, the command starts searching at element 1. The following project method deletes all empty elements from the string or text array whose pointer is passed as parameter: ` CLEAN UP ARRAY project method After this project method is implemented in a database, you can write: ARRAY TEXT(atSomeValues;...) The following project method selects the first element of an array whose pointer is passed as the first parameter that matches the value of the variable or field whose pointer is passed as parameter: ` SELECT ELEMENT project method After this project method is implemented in a database, you can write: ` asGender pop-up menu object method Note: This example uses the selected element of the array. Keep in mind that the selected element is not meaningful if the array contains more than 32,767 elements (see Arrays and Form Objects). In this case, you need to use a longint variable to store the result of Find in array. |
PROPERTIES
Product: 4D
HISTORY
Created: < 4D v6 SEE ALSO
DELETE FROM ARRAY ARTICLE USAGE
4D Language Reference ( 4D v11 SQL Release 6) Parent of : Find in array ( 4D v14 R4) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||