Subj : HW 100.2
To   : Finnigann
From : Amcleod
Date : Wed Oct 24 2001 10:50 am

RE: HW 100.2
BY: Finnigann to PistolGrip on Wed Oct 24 2001 02:40 pm

> So the 'file' is the handle that BAJA see it as... A varible, assigned in
> the act of opening the input.dat. I need to refer to THAT varible when
> manipulating INPUT.DAT ('file' was prolly a bad choice in that case).
> Maybe something descriptive would have been a better choice. Like
> 'Player_list' or 'Game_scores'

You've got the gist of it.  The file handle is a variable (in BAJA it is an
INT) that you use to refer to the file.  The FOPEN command assocuates a file on
disk, by name, with the file handle.  Then, everything else you do to that
file, you specify the file handle, rather than the name.

If writing a relatively simple program, you can name file handles like "in" and
"out" etc, but you _could_ open MANY files and refer to them at different
times.  In that case it is wise to name the handles something that will make
using them easier.  You might have CfgHnd, UsrHnd, LogHnd, InHnd, OutHnd, and
so forth, all open at once.  In languages that allow them, you could have an
ARRAY of handles, or even write file handles to a file and read them back later
(!) for arcane reasons.

The main thing to do is avoid mixing them up.  You don't want to accidentally
try weriting log-file entries to the read-only configuration file, just because
you called them 'abc' and 'xyz' and then got them mixed up in your mind!

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net