Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cdfb.utoronto!a228arig From: a228arig@cdfb.utoronto (Tak Ariga) Newsgroups: comp.sys.apple Subject: Finding if a file exists on a disk in Applesoft BASIC. Message-ID: <8704190657.AA12796@cdfb.toronto.edu> Date: Sun, 19-Apr-87 01:57:40 EST Article-I.D.: cdfb.8704190657.AA12796 Posted: Sun Apr 19 01:57:40 1987 Date-Received: Tue, 21-Apr-87 00:43:54 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 27 Can anyone inform me how I can find out if a given file exists on the disk or not through a BASIC (or a ML routine) program? I have this simple data base program that I wrote, and I don't want to overwrite files. Right now, I am using VERIFY to see if the file name exists. If it doesn't exists (the desired case), it causes an error. I use ONERR GOTO and use an error handling routine to deal with it. The problem is, it seems to clear some GOSUB stacks, and when it encounters a RETURN, it comes back with 'RETURN WITHOUT GOSUB ERROR', even though it was within a subroutine. I know this is a VERY bad way of doing things, but I wrote it when I was still in high school and knew very little of programming, and the only way I could figure out how to do it. I imagine I have to read the VTOC nicely, but I don't know how to do that. Help please. Thanks. --Tak ----------------------------------------------------------------------------- UUCP: {utzoo, decvax, ihnp4, cbosgd, utcsri, mnetor}!utgpu!utcdfa!a228arig ARPAnet: a228arig%cdfa.toronto.edu@relay.cs.net CSnet: a228arig%cdfa.toronto.edu BITNET: a228arig@utcdfa.UTORONTO == University of Toronto -- Toronto, Canada == -----------------------------------------------------------------------------