Following is a code I am trying to make it work for learning purposes. tf1,tf2,tf5
are Textfield, rs database, data is array object
I am trying to search for a string in textfield tf5 when ever I press search
button. This code does find
the string I am looking for but it continues to search and always displays
the last item on the array. Whats wrong with this
code I can't seem to solve the problem. any help would be appreciated.

String m=" ";
m=tf5.getText(); //get the string from textfield

for (int i=0; i<rs.n; i++){

if ([i].lLast.equals(m)) //here it looks as it found the text
and then continues as if did not find anything



class database {
Record rs=new Record();
public Record[] data = new Record[1000];
public int n=0;
public void store (Record rs) { //store String lLast,fFirst,sSS,aAge
data[n] =rs;


sudhir kapoor