On 28 Aug 2006 at 14:43, George Gwilt wrote:

> FTEST(a$) should return 0 if a$ is the name of an existing file that  
> can be opened or the name of a directory, but should return a  
> negative number otherwise. I was surprised to see that the following  
> program produced 0 instead of -7.
> 
> 1000  DIM k$(40)
> 1010  k$="win_j"
> 1020  PRINT FTEST(k$(1 TO ))
> 
> If line 1000 is omitted the correct answer, -7, is given. If line  
> 1020 is changed to PRINT FTEST(k$), again the correct result is given.
> 
> Clearly something is wrong with FTEST. However, users of TURBO will  
> be glad to know that when compiled all the versions of the program  
> given above produce a correct -7.
>
Hi,

just a quick reply, without any further checks:

if you replace the Ftest by a FOP_IN, you'll notice that the channel opened  
is not to win1_j, but to the "TK2" default directory. This always exists, 
hence the 0 result.


This would indicate to me that it isn't FTEST etc that is at fault, but that 
the parameter handling went wrong somewhere, probably in one of the numerous 
subroutines called by all of these functions.

I'll check further later when I have the time.
Thanks for pointing this out, George!

Wolfgang

www.scp-paulet-lenerz.com
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to