home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HomeWare 14
/
HOMEWARE14.bin
/
prog
/
ks94an.arj
/
WHICH_E.HDR
< prev
next >
Wrap
Text File
|
1994-04-24
|
1KB
|
58 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_Which_Element( aArrayName, cString, lBegins ) --> nElementNumber
PARAMETERS:
aArrayName : Array to search
cString : String to search for
SHORT:
Scan an array looking for the element that contains the specified value.
DESCRIPTION:
_Which_Element() searches a character array for a particular value and
returns the element number that matches the search criteria or zero if not
found.
If lBegins is TRUE, cString must BEGIN at position 1. (DEFAULT)
If lBegins is false, cString may occur anywhere in the element.
NOTE:
This function differs from ASCAN() only in that it will return the element
number that contains the specified data ANYWHERE in the element (not just at
the beginning). It can be made to operate identically to ASCAN() by
specifying TRUE in lBegins.
EXAMPLE:
#include "klipper.ch"
PRIVATE Names[5]
names[1] = 'John'
names[2] = 'James'
names[3] = 'Jenifer'
names[4] = 'Jeremy'
names[5] = 'Jacob'
t = _Which_Element(Names,'Jenifer',TRUE)
Result: t = 3
t = _Which_Element(Names,'Jenifer')
Result: t = 3
t = _Which_Element(Names,'Frank')
Result: t = 0
t = _Which_Element(Names,'rem',FALSE)
Result: t = 4
******************************************************************************/