|
FindArrayCell | ||||
StepsTaken = FindArrayCell(SearchArray(), StartElement, ElementDelta, Number, SearchValueOrString) | ||||
Parameters: SearchArray() = The Array you wish to search StartElement = The address of starting element ElementDelta = The difference between elements Number = The number of elements you wish to search for SearchValueOrString = The Value or String you wish to search for |
||||
Returns: StepsTaken = The number sof steps taken from the starting position |
||||
The FindArrayCell function can search either an entire array or a section, for either a value or a string. So FindArrayCell can be used on Integer, floating point arrays, and String arrays also. However the data type of SearchValueOrString (Integer/float/string) must match the type of array your searching. So you can only search for an integer values with within integer arrays. When FindArrayCell locates a matching element, it will return the number of steps it took to find this element from the starting location. One the most powerful features of PlayBASICs array commands is the ability to manipulate the data within any type of array, of any dimension. So these commands will work upon 1D arrays, 2D, 3D etc etc. FACTS: * FindArrayCell returns a -1 if no matches were found. * When FindArrayCell find a matching element it returns the number searches that were required from the starting point. * FindArrayCell can be used upon Integer,Floating Point an String arrays. * FindArrayCell is much faster than manually clearing array elements yourself. Mini Tutorial: This example creates an array called Table() and fill it with 10 values, ranging from 0 to 500. Then using [command name;] it locates
This Example would output
Filling a STRING Array with the string "Hello World"
This example would output.
|
Related Info: | SearchHighestArrayCell | SearchLowestArrayCell : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |