Re: [Ql-Users] A feature or a bug?
No, that does not work the same way, as if you set the three SV to "". Just try. I always set SV_DDLST to 0. original = peek_w (peek_l (sv_base+176)) : rem SV_DDLST poke_w peek_l (sv_base+176) , 0 : rem set to zero, TK2 has no default now ferr = fop_in (#5,fname$) : try to open_in the file error testing here Value back: poke_w peek_l (sv_base+176) , original : back to the TK2 default, the devstring is still in memory So there is nothing changed and the old devstring location is put, where it was before. No TK2 defaults. Cheers...Ralf - Original Message - From: "Wolf" To: Sent: Wednesday, June 15, 2016 6:49 AM Subject: Re: [Ql-Users] A feature or a bug? Hi, I often use something like this for ftest 100 DEFine FuNction ftest2(file$) 110 LOCal dad$,ded$,prd$,a 120 dad$=DATAD$ 130 ded$=DESTD$ 140 prd$=PROGD$ 150 DATA_USE "" 160 DEST_USE "" 170 PROG_USE "" 180 a=FTEST(file$) 190 DATA_USE dad$ 200 DEST_USE ded$ 210 PROG_USE prd$ 220 RETurn a 230 END DEFine ftest2 240 : HTH Wolfgang ___ QL-Users Mailing List
[Ql-Users] A feature or a bug? No, a feature
Hi, > > for some years I have a similar behaviour on my SMSQ/E bug list. Ok, but it's not a bug. > Just enter VIEW & . In case DATAD$ is set to a valid WINx_ (or FLPx_) > path (e.g. WIN1_ or WIN1_sys_) then you get the raw content of the directory > table listed. Yes, that is normal, view also uses the data default. > The RAM device driver seems not to be affected by this problem. Yes it is, it's just that you don't have enough files in the ram disk - copy some files into it, and you will see that it shows the same bevaviour. HTH Wolfgang ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
OK, sorry, but message implied this. Back to sleep again. Regards, Derek On 14/06/16 18:49, Marcel Kilgus wrote: Derek Stewart wrote: I am a little confused, where does DEV1_ default to DATAD$ Never. I said DATAD$ is DEV1_ on my machine. Marcel ___ QL-Users Mailing List ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Hi QLers, for some years I have a similar behaviour on my SMSQ/E bug list. Just enter VIEW & . In case DATAD$ is set to a valid WINx_ (or FLPx_) path (e.g. WIN1_ or WIN1_sys_) then you get the raw content of the directory table listed. The RAM device driver seems not to be affected by this problem. Enjoy the summer 2016 ;-) Rain, rain, rain and rain... QL forever! Urs http://www.sinclairql.net/ ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Hi, I often use something like this for ftest 100 DEFine FuNction ftest2(file$) 110 LOCal dad$,ded$,prd$,a 120 dad$=DATAD$ 130 ded$=DESTD$ 140 prd$=PROGD$ 150 DATA_USE "" 160 DEST_USE "" 170 PROG_USE "" 180 a=FTEST(file$) 190 DATA_USE dad$ 200 DEST_USE ded$ 210 PROG_USE prd$ 220 RETurn a 230 END DEFine ftest2 240 : HTH Wolfgang ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Yes. Cheers, Norm. On 14 June 2016 20:53:15 BST, "Ralf Reköndt" wrote: >Does this ommit TK2? > >- Original Message - >From: "George Gwilt" > >> Using Turbo Toolkit’s DEVICE_STATUS might be safer. >> >> George > >___ >QL-Users Mailing List -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
You could use max_devs and dev_name from the truly wonderful DJTOOLKIT too, if you were inclined! I'm surprised that DJ didn't mention it! ;) Cheers, Norm. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Does this ommit TK2? - Original Message - From: "George Gwilt" Using Turbo Toolkit’s DEVICE_STATUS might be safer. George ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
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" To: 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
Re: [Ql-Users] A feature or a bug?
- Original Message - From: "Marcel Kilgus" Ralf Reköndt wrote: It's really that awful, as OPEN tries the device you told it, then, if no success, uses DATAD$ or somewhat others, DEV or such. DATAD$, PROGD$ or DESTD$ is prepended to the filename, depending on the call. DEV is just a device like any other I think. Note that I do not endorse this design in any way, the whole filename handling in QDOSMSQ is not, let's say, optimal. But as I said it's been this way for 30 years, I don't see any urgency to change it now. Yes, but I found it the only way in S_Edit to see, if a filename really exists, not to pass it to DATD$ or similar. I set the SV_DATAD to "", kept the value, check the device and put it back. There were no other way. Ok, as far as I know. Cheers...Ralf ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Dilwyn Jones wrote: > There are device open functions out there in other toolkits which do the > same job without checking the TK2 defaults system. This is an important point. This is not an OS feature, i.e. the raw TRAPs do not behave this way, it's strictly a feature of the BASIC commands. That was the only way it could be implemented back then as the OS was fixed. If another utility wraps the open call it will get the "raw" behaviour. Ralf Reköndt wrote: > It's really that awful, as OPEN tries the device you told it, then, if no > success, uses DATAD$ or somewhat others, DEV or such. DATAD$, PROGD$ or DESTD$ is prepended to the filename, depending on the call. DEV is just a device like any other I think. Note that I do not endorse this design in any way, the whole filename handling in QDOSMSQ is not, let's say, optimal. But as I said it's been this way for 30 years, I don't see any urgency to change it now. All the best, Marcel ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
There are device open functions out there in other toolkits which do the same job without checking the TK2 defaults system. Also, it's easy enough to do an error-trapped open_in on most systems, whether you use WHEN ERRor (JS or later ROM), Q_ERR_ON (Qliberator compiler), WHEN_ERROR and DEVICE_STATUS (Turbo compiler) just to name a few. Dilwyn -Original Message- From: Ralf Reköndt Sent: Tuesday, June 14, 2016 7:20 PM To: ql-us...@q-v-d.com Subject: Re: [Ql-Users] A feature or a bug? It's really that awful, as OPEN tries the device you told it, then, if no success, uses DATAD$ or somewhat others, DEV or such. To be really successfull, you should set the SV_DATAD to "", keep the value then try to open the device. This is the only way to see, if *that* device is not present. - Original Message - From: "Marcel Kilgus" To: Sent: Tuesday, June 14, 2016 7:57 PM Subject: Re: [Ql-Users] A feature or a bug? François Van Emelen wrote: 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. That would actually be a somewhat cool feature, but DELETE is not as cool, so nothing will happen. Try it :) WDEL is a little bit more dangerous, but it still asks nicely and like DELETE it will also fail on directories. Thing is this: FTEST = OPEN:CLOSE. OPEN can be used without a parameter, in which case DATAD$ will be used. The same is therefore true for FTEST. It's actually been this way since the release of TK2 which has been how long ago, 30 years or so? All the best, Marcel ___ QL-Users Mailing List - 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 - 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
Re: [Ql-Users] A feature or a bug?
It's really that awful, as OPEN tries the device you told it, then, if no success, uses DATAD$ or somewhat others, DEV or such. To be really successfull, you should set the SV_DATAD to "", keep the value then try to open the device. This is the only way to see, if *that* device is not present. - Original Message - From: "Marcel Kilgus" To: Sent: Tuesday, June 14, 2016 7:57 PM Subject: Re: [Ql-Users] A feature or a bug? François Van Emelen wrote: 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. That would actually be a somewhat cool feature, but DELETE is not as cool, so nothing will happen. Try it :) WDEL is a little bit more dangerous, but it still asks nicely and like DELETE it will also fail on directories. Thing is this: FTEST = OPEN:CLOSE. OPEN can be used without a parameter, in which case DATAD$ will be used. The same is therefore true for FTEST. It's actually been this way since the release of TK2 which has been how long ago, 30 years or so? All the best, Marcel ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
François Van Emelen wrote: > 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. That would actually be a somewhat cool feature, but DELETE is not as cool, so nothing will happen. Try it :) WDEL is a little bit more dangerous, but it still asks nicely and like DELETE it will also fail on directories. Thing is this: FTEST = OPEN:CLOSE. OPEN can be used without a parameter, in which case DATAD$ will be used. The same is therefore true for FTEST. It's actually been this way since the release of TK2 which has been how long ago, 30 years or so? All the best, Marcel ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
I think it's just that Marcel normally just uses DATA_USE dev1_ on his system. Dilwyn -Original Message- From: Derek Stewart Sent: Tuesday, June 14, 2016 6:27 PM To: ql-us...@q-v-d.com Subject: Re: [Ql-Users] A feature or a bug? On 14/06/16 14:43, Marcel Kilgus wrote: 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 ___ QL-Users Mailing List Hi Marcel, I am a little confused, where does DEV1_ default to DATAD$ If I startup QPC2 with no boot device defined, the DATAD$ is flp1_, which is the default of config block in the SMSQE file and DEV1_ is undefined. Can expand on this, I am havong a thick moment... Regards, Derek ___ QL-Users Mailing List - 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 - 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
Re: [Ql-Users] A feature or a bug?
Derek Stewart wrote: > I am a little confused, where does DEV1_ default to DATAD$ Never. I said DATAD$ is DEV1_ on my machine. Marcel ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
On 14/06/16 14:43, Marcel Kilgus wrote: 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 ___ QL-Users Mailing List Hi Marcel, I am a little confused, where does DEV1_ default to DATAD$ If I startup QPC2 with no boot device defined, the DATAD$ is flp1_, which is the default of config block in the SMSQE file and DEV1_ is undefined. Can expand on this, I am havong a thick moment... Regards, Derek ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
> On 14 Jun 2016, at 16:45, François Van Emelen > wrote: > > Op 14/06/2016 om 16:18 schreef George Gwilt: >>> On 14 Jun 2016, at 14:56, Bob Spelten wrote: >>> >>> Op Tue, 14 Jun 2016 15:43:00 +0200 schreef Marcel Kilgus >>> : >>> 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 Using Turbo Toolkit’s DEVICE_STATUS might be safer. George ___ QL-Users Mailing List
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
Re: [Ql-Users] A feature or a bug?
Op 14/06/2016 om 16:18 schreef George Gwilt: On 14 Jun 2016, at 14:56, Bob Spelten wrote: Op Tue, 14 Jun 2016 15:43:00 +0200 schreef Marcel Kilgus : 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
Re: [Ql-Users] A feature or a bug?
> On 14 Jun 2016, at 14:56, Bob Spelten wrote: > > Op Tue, 14 Jun 2016 15:43:00 +0200 schreef Marcel Kilgus > : > >> 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
Re: [Ql-Users] A feature or a bug?
Bob Spelten wrote: > I understand the datad$ but the problem is why FTEST returns a zero? I don't understand, why shouldn't it? > FTEST should return a -7, so DIR is should not be done. Clearly the directory pointed to by DATAD$ exists, so why whould it return -7? Marcel ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
Op Tue, 14 Jun 2016 15:43:00 +0200 schreef Marcel Kilgus : 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. Bob -- The BSJR QL software site at: http://members.upc.nl/b.spelten/ql/ ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
I tried this and it worked as reported. I then did this: data_use "" then I ran it again, and got the error message. This confirms that datad$ is being picked up and used in the FTEST. Tim ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
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 ___ QL-Users Mailing List
Re: [Ql-Users] A feature or a bug?
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. Marcel ___ QL-Users Mailing List
[Ql-Users] A feature or a bug?
Hi, 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 ___ QL-Users Mailing List