BBC BASIC for Windows
« Disc drive check »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:57pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Disc drive check  (Read 675 times)
sveinioslo
Developer

member is offline

Avatar




PM


Posts: 64
xx Re: Disc drive check
« Reply #3 on: Mar 18th, 2015, 12:16pm »

Maybe this proc does the trick ?

Svein

Code:
 
      DEF PROCdeletefile(file$)
      ON ERROR LOCAL : ENDPROC
      OSCLI "DEL "+file$
      ENDPROC
 

User IP Logged

rtr2
Guest
xx Re: Disc drive check
« Reply #4 on: Mar 18th, 2015, 1:03pm »

on Mar 18th, 2015, 12:16pm, sveinioslo wrote:
Maybe this proc does the trick ?

Or, more straightforwardly (and no need for a PROC):

Code:
      SYS "DeleteFile", file$ 

But I already suggested that to the OP, and he said he tried it, so probably the error message he is referring to is a popup window like the one you get with a missing floppy.

Richard.
« Last Edit: Mar 18th, 2015, 1:04pm by rtr2 » User IP Logged

sveinioslo
Developer

member is offline

Avatar




PM


Posts: 64
xx Re: Disc drive check
« Reply #5 on: Mar 18th, 2015, 9:55pm »

I was hoping that the "No disc is in drive" error was trappable.
Can't test it at my current location.

Svein
User IP Logged

TheFamousCash
New Member
Image


member is offline

Avatar




PM


Posts: 16
xx Re: Disc drive check
« Reply #6 on: Mar 19th, 2015, 12:21pm »

Many thanks for assistance. I have found solution. Cycling through to discover which LT$ is actual disc drive using below PROC and checking to see if file$ present. If CDFLAG%=1 then simple OSCLI "DEL """+file$+"""" completes.

DEFPROCCHECKDISK(LT$)
ON ERROR LOCAL:ENDPROC
OSCLI "CD """+LT$+""""
LOCAL dir%, sh%, res%
DIM dir% LOCAL 317
SYS "FindFirstFile", "*", dir% TO sh%
IFsh%<>-1P%=OPENUPfile$:IFP>0CDFLAG=1:CLOSE#P%
ENDPROC




User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls