RE: File access - BAJAãP>BY: Jim King to ALL on Mon Apr 02 2001 06:12 pmããP> > Would someone be willing to write and explain a simple (short) programãP> > that reads from and writes to a file in Baja?ããP>This is an example using a binary file.ããããP>Hope this helps.ããP>PGããThanks PistolGrip, it's a start.ãã-ãJames King, Coldwater, Mi And that's JIM to you guys! ã Tip of the day: http://setiathome.berkeley.edu ã---ã þ OLXWin 1.00b þ Jesus saves, passes to Moses, up the court, shoots scoresã þ Synchronet þ Bits-N-Bytes One hell of a BBS 24.241.127.99ã
RE: File access - BAJAãA>BY: Jim King to ALL on Mon Apr 02 2001 06:12 pmããA> > Would someone be willing to write and explain a simple (short) programãA> > that reads from and writes to a file in Baja?ãA> > ãA> > Use as many of the file accessing routines found in Baja.ãA> > ãA> > From Baja Docs:ãA> > ãA> > FOPEN <int_var> <#> <"str" or str_var> FILE_IO.INCãA> > args: handle access path_and_filenameãA> > ãA> > FREAD <int_var> <any_var> [int_var or #]ãA> > args: handle dest lengthãA> > ãA> > FCLOSE <int_var>ãA> > args: handleããA>Essentially you have it covered, except: I'd recommend first a program thatãA>opened the file, WROTE some data and then closed it. You decide what goesãA>into the file, what the format is, etc, etc, and you should have a pretty goodãA>idea what to expect in that file when the program has executed. ããExactly, the module would be reading from a structured file (ie aãconfig file) to write to another structured file (a batch file)ãIn addition to writing to xtrn.cnf (a file of undetermined structureã:-)ããA>THEN your SECOND program essentially does the opposite. Open the same file,ãA>read back the data and display it to confirm that you i) wrote it correctly;ãA>ii) read it back as expected.ããA>Do you understand the arguments to the commands listed above? ("handle",ãA>"access", etc) Or do you need someone to run through them with you first?ããI have all the Baja Docs printed out however as it was in the twoãyears of Latin class I find I learn fastest with examples.ããI have the basic premise worked out (in my head) and now I am tryingãto translate it into Bajaese. (and in the process learn aboutãprogramming)ããI'm not saying that Baja is the simplest language, just the one withãthe most programmers I know.ããEnough blather...ããPG's examples are helpful, but as I said writing to xtrn.cnf can beãwreckless if I'm not careful. So I need more info on set_posããIt occurred to me to ask the man his self. I got back..ã from \sbbs\cnfs.fmtã total_xtrns 2ã ... xtrn->sec 2ã ... xtrn->name 41ã ... xtrn->code 9ã ... xtrn->ar 41ã ... xtrn->run_ar 41ã ... xtrn->type 1ã ... xtrn->misc 4ã ... xtrn->event 1ã ... xtrn->cost 4ã ... xtrn->cmd 64ã ... xtrn->clean 64ã ... xtrn->path 64ã ... unused 16ããKnowing all this... how would I translate ... say "xtrn->code 9" into aãfread statement? Using "%!\..\crtl\xtrn.cnf" as the source.ããã-ãJames King, Coldwater, Mi And that's JIM to you guys! ã Tip of the day: http://setiathome.berkeley.edu ã---ã þ OLXWin 1.00b þ Press "+" to see another tagline.ã þ Synchronet þ Bits-N-Bytes One hell of a BBS 24.241.127.99ã
RE: File access - BAJAãA>BY: Jim King to Amcleod on Tue Apr 03 2001 06:17 amããA> > Knowing all this... how would I translate ... say "xtrn->code 9" into aãA> > fread statement? Using "%!\..\crtl\xtrn.cnf" as the source.ãã[ - Message Saved - ]ããStudy time.ããã-ãJames King, Coldwater, Mi And that's JIM to you guys! ã Tip of the day: http://setiathome.berkeley.edu ã---ã þ OLXWin 1.00b þ Hello, I am part numberã þ Synchronet þ Bits-N-Bytes One hell of a BBS 24.241.127.99ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 54 |
Nodes: | 8 (0 / 8) |
Uptime: | 128:35:36 |
Calls: | 700 |
Files: | 17,895 |
D/L today: |
128 files (60,769K bytes) |
Messages: | 66,010 |