Help Center

DSAFEARRAY.Findmethod

Scans the array to search for the specified string.

COMmethodDSafeArray.incdocumented

Syntax

FUNCTION Find (BYREF wszFind AS WSTRING, BYVAL IgnoreCase AS BOOLEAN = TRUE) AS LONG

Parameters

NameDescription
wszFindThe string to find.
IgnoreCaseOptional. 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