• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with results returned from criteriaFind

 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code My search algorithm works find but I cant get it to return values when I set to another temprv array..

else if(source == searchButton)
{
try {

Data myData = new Data("db.db");
.
.
.
.
.
myInfo[] = myData.criteriaFind(criteria);
.
.
//this above code is my client
then for the data class.........

if (found)
{
DataInfo temprv = new DataInfo(r, description, values);
System.out.println(temprv.toString());
//rv[counter] = temprv;//insert temp rv into rv forrecordfound counter++;
found = false;
System.out.println("Match Found!!!");
}
else //debugg
{
System.out.println("No Match Found!!!");

}
when I comment out the new array rv[counter] i can print everything all records found in DOS
but when I uncomment it it returns null to the client
any help is greatly appreciated
Thanks Lisa
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lisa,
I think you have forgotten to allocate memory for the array of object reference rv.
Rudy
 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rudy
I believe I did allocate memory by
DataInfo rv = new DataInfo[recordCount];
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lisa,
Could it be your counter available out of range or you are referencing an incorrect counter value?
Rudy
 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hat was a good thought but no I checked that too.
Thanks Rudy see my other problem I just recently posted
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so have you resolved the problem then, and what is it all about?
 
Lisa Foster
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rudy still working on the problem..
Lisa
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic