Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Daniel Wu
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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!!!
 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic