Computer Science Canada

Help datafile

Author:  KONjbnj [ Wed Jun 08, 2005 8:31 am ]
Post subject:  Help datafile

hey..i was wondering how would u be able to make a loop so that it only reads parts of a datafile i tried exit when when it gets to a certain part but it doesnt work..i need the loop to stop at a certain point.

thanks

[code]
loop

exit when eof (datafile)
get : datafile, food, price, combo, save
put food : 20, price : 10, combo : 10, save : 10
exit when food ="hamburger"
delay (100)


end loop
[/code]

Author:  jamonathin [ Wed Jun 08, 2005 11:40 am ]
Post subject: 

Yes it is possible, you just have your coding wrong.

Take a look at these two programs. 'data' is just the text, and 'data get' gets the data.

Remove the comment to stop at hamburger.

Author:  Cervantes [ Wed Jun 08, 2005 5:50 pm ]
Post subject: 

jamonathin wrote:
Yes it is possible, you just have your coding wrong.

En contrare, I think he's got his text file wrong. Assuming the textfile is set up in the correct format (food, price, combo, save), his code should work.
KONjbnj, would you please post the data file you were using?

Author:  Delos [ Wed Jun 08, 2005 6:48 pm ]
Post subject: 

Cervantes->Delos.babel fish wrote:

"Au contraire"

Author:  KONjbnj [ Thu Jun 09, 2005 8:01 am ]
Post subject: 

`here is datafile

Author:  KONjbnj [ Thu Jun 09, 2005 8:27 am ]
Post subject: 

yay, I got it to work! thanks guys

though i dont think i did it how you guys did it.

Author:  jamonathin [ Thu Jun 09, 2005 8:50 am ]
Post subject: 

Cervantes wrote:
I think he's got his text file wrong.


Yeah, you have to have the same casings KonJubIXoRz


: