DSAFEARRAY.Findmethod
Scans the array to search for the specified string.
Syntax
FUNCTION Find (BYREF wszFind AS WSTRING, BYVAL IgnoreCase AS BOOLEAN = TRUE) AS LONG
Parameters
| Name | Description | |
|---|---|---|
wszFind | The string to find. | |
IgnoreCase | Optional. TRUE = Ignore case. |
Return value
The index of the retrieved array element, or 0 on failure.
Description
Scans the array to search for the specified string.
Example
' // Create a one-dimensional array of strings DIM dsa AS DSAFEARRAY = DSAFEARRAY("BSTR", 2, 1) dsa.PutStr(1, "Test string 1") dsa.PutStr(2, "Test string 2") dsa.InsertStr(2, "12345.67") DIM nPos AS LONG = dsa.Find("Test string 2") PRINT nPos
Reference
- Include file
DSafeArray.inc - Defined in AfxNova/DSafeArray.inc:2127
- Documented in COM/DSAFEARRAY Class.md
- Topic: DSAFEARRAY Class