Op 14/06/2016 om 16:18 schreef George Gwilt:
On 14 Jun 2016, at 14:56, Bob Spelten <b...@upcmail.nl> wrote:
Op Tue, 14 Jun 2016 15:43:00 +0200 schreef Marcel Kilgus
<ql-us...@mail.kilgus.net>:
Marcel Kilgus wrote:
François Van Emelen wrote:
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?
Because SMSQ/E defaults to dev1_ if you don't give a filename, I
presume.
Strike that, it defaults to datad$ of course, which is set to "dev1_"
in my case. I mean, that's what DATA_USE is for, providing a default
directory for file operations.
Marcel
I understand the datad$ but the problem is why FTEST returns a zero?
FTEST should return a -7, so DIR is should not be done.
The manual says that FTEST tests "a file or device”. Thus FTESTing win4_, say,
returns “0” even if win4_ contains no files.
George
_______________________________________________
QL-Users Mailing List
So, this seems to be a feature... a very dangerous one : replacing DIR
f$ in line 30 with DELETE f$ would wipe all directories and files on
that device.
And there is no Undo available .
François Van Emelen
_______________________________________________
QL-Users Mailing List