Computer Science Canada Prity easy, but cant figure it out! |
Author: | styxx [ Fri May 06, 2005 1:39 pm ] | ||
Post subject: | Prity easy, but cant figure it out! | ||
Alright I have been trying to make this work but it does'nt seem to want to... its a simply phone book with a file called direct.t (with a bunch of names & numbers) that it opens and reads. Then once you type in the name of the person it should output the name & number but it doesnt work.
thanks in advance! |
Author: | Token [ Fri May 06, 2005 4:46 pm ] | ||
Post subject: | |||
its because the file with the names and numbers isnt there, so put this in front of your code but after your variables
you have to check and not just create it incase you already had a list it would overwrite it. |
Author: | styxx [ Fri May 06, 2005 5:21 pm ] |
Post subject: | |
Changed it and still does'nt work ... any other ideas? |
Author: | Token [ Fri May 06, 2005 6:58 pm ] | ||||||||
Post subject: | |||||||||
well i didnt realise that was the problem, what you have to do it make a record, that would look like this
then make that record into an array.
okay so now you read from the file and assign the name and number accordingly
then what you do is get the name you want to search for and cyce through the array searching to see
and there you have it! hope it helps i was thinking about making a tutorial for databases and searching through databases... BTW. styx kicks ass (the band that is) |