ALOC(1,2,3)
PURPOSE
You can use this function to find an array element number based on a value you specify.
PARTS
1 f/c/e | Required - The field value to search for. |
2 fn/v | Required - The array field to search. |
3 f/c/e | The array element value to start with. If none is provided the program will start with the first. |
RETURN TYPE - R
The element number if found.
COMMENTS
If there is a match for the search field value the program will return the array element number. If no match is found the return value will be 0.
NOTE: Do not specify an array element in the array field to search for (part 2). If you wish to start with an element other than 1 specify that value in part 3.
NOTE: Parameter 1, Field Value to search for can not be a Codebase field. You must place the Codebase field value in some defined holder field to work with codebase type databases.
EXAMPLE
define x type a size 5 array 5
x[1] = 'abc'
x[2] = 'def'
x[3] = 'ghi'
x[4] = 'jkl'
x[5] = 'mno'
define r type r
r = ALOC('jkl', X, 0)
// r = 4
r = ALOC('abc', X, 3)
// r = 0
See Also
Page url: http://www.cassoftware.com/tas/manual/arraylocation().htm