And to start with, if you really want help with code you should first read this thread
which is stuck at the top of the forum. That way we could look at your code like this:
public int indexOfList (ListField fieldVar,String prefix,int start)
for (int a=0; a<_table.size();a++)
Object obj= _table.elementAt(a);
if(obj instanceof String)
bolResult = entry.startsWith(prefix);
Dialog.inform(""+bolResult+" "+prefix+" "+entry);
I assume you are trying to implement ListFieldCallback.indexOfList. If true your implementation does not really match the contract specified by the API documentation. You probably don't really want to be popping up Dialogs in that method either as it could quickly get messy. If you want to provide debugging output I would recommend System.out.println()
In any case: the search is supposed to start at start, not 0; if a match is not found it should return fieldVar.getSelectedIndex(); or if the search is not appropriate in context return -1.
If you don't pop up modal dialogs, you can probably dispense with the call to setFocus() which should likely be called on a defined variable, fieldVar? Or is listField (and searchIndex for that matter) defined elsewhere? This may go for the call to setSelectedIndex as well, but as SunitK said, what are you trying to do?