Well, in the first place, I always thought, that FTEST makes an direct check on the file or device, omitting every TK2 occurence. Unfortunately, I was wrong.

----- Original Message ----- From: "Dilwyn Jones" <[email protected]>
To: <[email protected]>
Sent: Tuesday, June 14, 2016 6:07 PM
Subject: Re: [Ql-Users] A feature or a bug?


Can someone explain this?
10 f$="":REMark empty string
20 if FTEST(f$)=0
30 DIR f$
40 ELSE
50 PRINT f$," can't be a file name"
60 ENDIF
Why is line 30 executed (displaying the directory of datad$) instead of line 50? IF line 30 is replace with VIEW f$ then the content of win (in my case Win2_) is displayed.
Can someone confirm the above program?

François Van Emelen
FTEST("") is essentially FTEST(DATAD$) as Marcel and Tim have pointed out. The TK2 extensions like this all pick up the system defaults.

a root drive name such as WIN1_ or WIN2_ on a level 2 system contains the list of files details for the directory, as you'll see if you COPY WIN1_ TO SCR.

So, I would politely suggest you do NOT put DELETE or WDEL in line 30, François!!! (unless you enjoy putting your win drives at risk of self-destruct)

I daresay you could use a clumsy coding liek this to work around it:

5 d$=DATAD$:DATA_USE ""
10 f$=""
20 IF FTEST(f$)=0
...
70 DATA_USE d$

(even then there is a the risk another job might alter DATA_USE in between lines of your program, just to screw things up, and beware of when DATAD$ returns just '_')

As an aside, the null filename used to be used (on level 1 filing systems) in protection systems as a kind of hidden file in the early days of QL software.

Dilwyn




-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7639 / Virus Database: 4604/12419 - Release Date: 06/14/16

_______________________________________________
QL-Users Mailing List

_______________________________________________
QL-Users Mailing List

Reply via email to