Would someone be willing to write and explain a simple (short) program
that reads from and writes to a file in Baja?
Would someone be willing to write and explain a simple (short) program
that reads from and writes to a file in Baja?
Use as many of the file accessing routines found in Baja.
From Baja Docs:
FOPEN <int_var> <#> <"str" or str_var> FILE_IO.INC
args: handle access path_and_filename
FREAD <int_var> <any_var> [int_var or #]
args: handle dest length
FCLOSE <int_var>
args: handle
RE: File access - BAJA
BY: Jim King to ALL on Mon Apr 02 2001 06:12 pm
Would someone be willing to write and explain a simple (short) program that reads from and writes to a file in Baja?
This is an example using a binary file.
Hope this helps.
PG
RE: File access - BAJA
BY: Jim King to ALL on Mon Apr 02 2001 06:12 pm
Would someone be willing to write and explain a simple (short) program that reads from and writes to a file in Baja?
Use as many of the file accessing routines found in Baja.
From Baja Docs:
FOPEN <int_var> <#> <"str" or str_var> FILE_IO.INC
args: handle access path_and_filename
FREAD <int_var> <any_var> [int_var or #]
args: handle dest length
FCLOSE <int_var>
args: handle
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
idea what to expect in that file when the program has executed.
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.
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?
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.
Knowing all this... how would I translate ... say "xtrn->code 9" into a fread statement? Using "%!\..\crtl\xtrn.cnf" as the source.
RE: File access - BAJA
BY: Jim King to Amcleod on Tue Apr 03 2001 06:17 am
Knowing all this... how would I translate ... say "xtrn->code 9" into a fread statement? Using "%!\..\crtl\xtrn.cnf" as the source.
Sysop: | Chris Crash |
---|---|
Location: | Huntington Beach, CA. |
Users: | 578 |
Nodes: | 8 (0 / 8) |
Uptime: | 29:34:35 |
Calls: | 10,736 |
Calls today: | 1 |
Files: | 5 |
Messages: | 443,197 |
Posted today: | 1 |