BBC BASIC for Windows
« File exists »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:41pm



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: File exists  (Read 983 times)
MrStreet
New Member
Image


member is offline

Avatar




PM


Posts: 8
sad Re: File exists
« Reply #9 on: Jun 8th, 2011, 5:42pm »

Can't I create the NUL file using the usual OPENOUT and put it into the projects folder when the program creates it the first time?
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
sad Re: File exists
« Reply #10 on: Jun 8th, 2011, 8:17pm »

on Jun 8th, 2011, 5:42pm, MrStreet wrote:
Can't I create the NUL file using the usual OPENOUT and put it into the projects folder when the program creates it the first time?

You can't create a NUL file - it's a forbidden file name. But since you are wanting to test for the existence of a directory which you have created yourself, why not simply store a file there specifically for the purpose? Because you know that file will always be there, you can simply test for it being present - you don't actually need to test for the existence of the directory itself!

Richard.
User IP Logged

MrStreet
New Member
Image


member is offline

Avatar




PM


Posts: 8
sad Re: File exists
« Reply #11 on: Jun 8th, 2011, 8:19pm »

Many thanks again, Richard.
User IP Logged

MrStreet
New Member
Image


member is offline

Avatar




PM


Posts: 8
sad Re: File exists
« Reply #12 on: Jun 11th, 2011, 11:24am »

I think I have fixed the problem using an on error local statement call to :-

Code:
      
      deffn_setupError
      if err=196 then
        rem  file exists error
        = false
      else
        if fn_FAULT_M(" I am sorry the following error occured during setup: "+LF$+LF$+report$+LF$+LF$+" Do you want to quit?") then
          = true
        else
          =false
        endif
      endif
 
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