From: Ian L. <dr...@gm...> - 2006-11-16 23:27:46
|
Actually, I haven't given it much thought, but you're right, it would be good to have that. We could have an FOPEN, FREAD, and FWRITE command. I'm just unsure of whether they should work at the byte or character level. What I usually do is write an example program or tutorial first, and then code the commands. It helps to focus on what is actually necessary to teach kids. Traditionally BASIC used READ and DATA statements for data input, but personally I was never crazy about that approach, most importantly because I think data should be a separate entity from the program that reads/alters it. The approach that LISP takes for file input is nice. You can use the lisp read command on an open file to read a token, or read-line to read a line. There's also read-char and read-byte. This might be the best way to handle it, so kids can have a text file of data separated by white space and just read each token in one at a time. -Ian On 11/16/06, Ferry Hendrikx <fer...@gm...> wrote: > Has anyone given any thought to file access? It would be useful to be > able to open, read and write text files... > > Cheers > > /Ferry > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Kidbasic-devel mailing list > Kid...@li... > https://lists.sourceforge.net/lists/listinfo/kidbasic-devel > |