[futurebasic] Re: [FB] Determining a free file ID

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1999 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Sat, 09 Jan 1999 18:36:36 +0100
Osamu wrote:
> How about using ToolBox?
> The sample code is included for mini-runtime, or code resource.

I know it is there but I'll study it later

> Normally, you can only open two file at same time.

I think this is a setting in the FB preferences panel, it seems that you can
have up to 99 files opened at the same time. But, strangely when I set this
preference to 0 or 1 my revised piece of code still works (I tested it with
two files opened at the same time, using the Derek's function).
I'm sure I'm missing something here. Or could it be that I have something
wrong in my machine, besides why the piece of code I sent didn't work leading
me systematically to Macsbug?

Derek wrote:
> This is what I use to find an available file number when using the OPEN
> statement:

> CLEAR LOCAL MODE
> DIM fnum
> LOCAL FN FindUnusedFileRef
>   fnum = 1
>   WHILE USR _Fileaddr(fnum)
>     INC(fnum)
>   WEND
> END FN = fnum

Thanks for that one, it feels my need, but now I'm still wandering in which
case your function has a chance to fail, perhaps it is wiser to add
WHILE USR _Fileaddr(fnum) AND fnum<100

Jonathan wrote:
> Funny - this is what i originally suggested to Alain by
> telephone (we've found that we live about 2 blocks away
> from each other - but we met on the list!). He found it
> inelegant,and that was how we got onto using ERRORs to
> do it.
> But anyway after elegant code can't be a baddie ;-)

Well,  I use to think like you that elegant is very often synonym of efficient
in computer land. (don't know if efficient is an English word).
The last remark to bring another topic and take the opportunity to correct one
of your recent posts. I never said that you were incomprehensible, I just told
you that _sometimes_ I found difficulties in reading your posts, but this is a
weakness of mine, never yours. It is nothing compared to ... Lucy's posts who
beats everyone hands off. Most of the time I scratch my head wandering in
which language she was speaking. I always have a hard time to decipher her
writings because it doesn't resemble to what I learned at school a long time
ago. On the opposite, Rick's posts are the  easiest to read for me, it is like
I'm reading French directly.
I have here a special thought for Andy Gariepy, 'cos I had the chance(?) to
read some of his mails.
Is this guy speaking alien?

See you

Alain