Navigation:  Reference > Functions >

ArrayLocation()

Print this Topic Previous pageReturn to chapter overviewNext page

 

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/eRequired - The field value to search for.

 

2 fn/vRequired - The array field to search.

 

3 f/c/eThe 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

 

UPDTA

 

 

 

 


Page url: http://www.cassoftware.com/tas/manual/arraylocation().htm