Title: Message
|
If it wasn't an array of strings, say an array of
records with a string in the structure, would this work.
var (global)
A: Array of MyRec;
var (local)
B: Array of Char Absolute
MyRec;
begin
Result := pos('Hello World',string(B)) >
0;
end;
Ross.
----- Original Message -----
Sent: Thursday, June 03, 2004 5:21
PM
Subject: RE: [DUG] "IN" an array?
If
you are using D7 and you are talking about array of strings, then you are in
luck. There is a function called AnsiIndexStr() that can search for a string
in an array of strings, case-sensitive, or AnsiIndexText(),
case-insenstitive.
Cheers,
Kuet-Fung
Just curious. Since arrays occupy
contiguous memory space, would there be a way of testing the whole
array as one large string, and use the pos function?
Ross.
----- Original Message -----
Sent: Thursday, June 03, 2004 4:39
PM
Subject: RE: [DUG] "IN" an
array?
you'll have to iterate the array and check each value for a
match
something like ::
for i := low(myArray) to high(myArray) do
if myArray[i] = iValue then
begin
// match found
break;
end;
IN is a set operator.
_______________________________________________ Delphi mailing
list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
|
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi