compare string

  • Thread starter Thread starter El Camino
  • Start date Start date
E

El Camino

Merry Christmas to you all

What better then spending crhistmas eve doiing all little
coding.... with some baileys coffee of course!! :)

Heres the prob.

I need to compare to string

lets say i have dataset with 10 row:
on of the row as:
..item("Santa")

If the user type "t" in a text box, i need do a loop in
the dataset to see if any item would be equal at it.

I stop at the first find and display the item.

how can i do that?
Thanx
El Camino
 
I would use Regular Expressions rather than loop. It will throw back an
array of positions for a certain expression. In Santa, it would find one
item, but in ho ho ho, it would find none. Merry Christmas.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Hi El Camino
\\\
for i as integer = 0 to ds.tables(0).rows.count -1
if ds.tables(0).rows(i).item("Santa").tostring.indexof("t") <> -1
exit for
end if
next
me.textbox1.text = ds.tables(0).rows(0).item("Santa").tostring
///
Could not find one with shorter code that was as fast as this one with 10
rows.

Marry christmas

Cor
 
Small error but you saw it I think, but so I can correct that marry
christmas also
Hi El Camino
\\\
for i as integer = 0 to ds.tables(0).rows.count -1
if ds.tables(0).rows(i).item("Santa").tostring.indexof("t") <> -1
exit for
end if
next
me.textbox1.text = ds.tables(0).rows(0).item("Santa").tostring
me.textbox1.text = ds.tables(0).rows(i).item("Santa").tostring

Merry Christmas

Cor
 
El Camino said:
If the user type "t" in a text box, i need do a loop in
the dataset to see if any item would be equal at it.

I stop at the first find and display the item.

Are you trying to write something like the 'find as you type' feature in QuickBooks?
 
Back
Top