• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why doesn't find("3") work?????

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folx, please help me!!!
[CODE]
Data data=new Data(location);//works fine
DataInfo result3=null;//wrong?
result3=data.find("3");//output is result3 is null, why???[CODE]
Thanks a lot for considering it!!!
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Daniel,
You wrote:
[CODE]
Data data=new Data(location);//works fine
DataInfo result3=null;//wrong?
result3=data.find("3");//output is result3 is null, why???[CODE]
In my code Data's find compares the argument with the values[0],
where values[] is a DataInfo array. Therefore, I think, it should
match with Flight number and in my database there is no such
a number.
Chiao,
Ban
 
Daniel Wu
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andras,


In my code Data's find compares the argument with the values[0],
where values[] is a DataInfo array.


Same with mine!

Therefore, I think, it should
match with Flight number and in my database there is no such
a number.


Yeah, you are right! i agree with you that the argument toMatch should match with some Flight number! In my db.db file, THERE IS FLIGHT NUMBER. a typical output of a record is:
suncerfiy.db.DataInfo@2f6684recordNumber = 1
Fields: Name = Flight number value = SA001
Name = Origin airport value = SFO
......
I did wrong the first time for i followed Sun's instruction and use a record number as the argument which always "find" a null result. When Flight number value, say SA001, is used as "toMatch" string, the expected result comes out!
Thus, sun's wording is not quite right when it says "For this assignment, the key field is the record number field...@param toMatch The key field value to match upon for a successful find".
Anyone please correct me if i missed something here. Andras, thank you and good luck!
cheers!
Daniel
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic