Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_afind() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_AFIND()

 DESCRIPTION

 C_AFIND() searches a specified ClipOn array for the first element
 where the contents of that element match the specified numeric
 value.  Optional starting and ending parameters can be used to
 control the range of the search in the array.  (Refer to Chapter 3
 for a complete discussion about ClipOn arrays.)

 NOTES

 The numeric reference for the ClipOn array is a pointer to the
 array in memory.  Be careful not to change the value of this
 pointer, or the array will be unaccessible.

 SYNTAX

 C_AFIND(array, value [,st_pos] [,end_pos])

 PARAMETERS

 array (N) is the numeric reference variable for the ClipOn array.

 value (N) is the numeric value to find in the array.

 st_pos (N) is the starting element to begin the search in the
 array.  If st_pos is not specified, the search begins with the
 first element.

 end_pos (N) is the ending element to stop the search in the array.
 If end_pos is not specified, the search ends with the last element.

 RETURNS

 C_AFIND() returns the element number for the matching value if
 found, or zero (0) if not found.

 EXAMPLES

 a1 = c_adeclare(100)      && Declare array for 100 elements

 for i = 1 to 100          && Fill first 100 elements of array with
   c_aput(a1,i,i)          && numbers 1 through 100.
 next
 ...
 ? c_afind(a1,1)        --> 1    && Found value 1 in element 1
 ? c_afind(a1,99)       --> 99   && Found value 99 in element 99
 ? c_afind(a1,125)      --> 0    && Value 125, not found
 ? c_afind(a1,25,1,30)  --> 25   && Searched 1 to 30, found in 25
 ? c_afind(a1,25,30,50) --> 0    && Searched 30 to 50, not found
 ...
 c_arelease(a1)       && Release array


See Also: C_ADECLARE() C_APUT() C_AGET() C_ASIZE() C_ASEARCH()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson