Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ames!ucbcad!ucbvax!POMONA.BITNET!MAINT From: MAINT@POMONA.BITNET Newsgroups: comp.sys.apple Subject: BITNET mail follows Message-ID: <8704222119.aa03261@SPARK.BRL.ARPA> Date: Wed, 22-Apr-87 19:59:00 EST Article-I.D.: SPARK.8704222119.aa03261 Posted: Wed Apr 22 19:59:00 1987 Date-Received: Sat, 25-Apr-87 09:50:54 EST Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 55 ========================================================================= Received: by POMONA (Mailer X1.23b) id 1369; Wed, 22 Apr 87 09:53:46 PDT Date: Wed, 22 Apr 87 09:47:09 PDT From: Network Mailer Subject: Undelivered mail To: MAINT@POMONA Your mail was not delivered to some or all of its intended recipients for the following reason(s): Transferred files not allowed(Check if it was a bad RSCS node). --------------------RETURNED MAIL FILE-------------------- Received: from BRL-SMOKE.ARPA by wiscvm.wisc.edu on 04/21/87 at 02:19:38 CDT Received: from BRL-SMOKE.ARPA by SMOKE.brl.ARPA id aa26787; 21 Apr 87 0:31 EDT Received: from BRL-SPARK.ARPA by SMOKE.BRL.ARPA id aa26585; 21 Apr 87 0:10 EDT Received: from UCBVAX.Berkeley.EDU by SPARK.BRL.ARPA id aa02466; 21 Apr 87 0:02 EDT Received: by ucbvax.Berkeley.EDU (5.57/1.23) id AA09947; Mon, 20 Apr 87 19:43:04 PST Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-apple@brl.arpa (info-apple@brl.arpa) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 21 Apr 87 02:21:49 GMT From: paul nakada Organization: Harvard Univ. Science Center Subject: Re: Finding if a file exists on a disk in Applesoft BASIC. Message-Id: <1701@husc6.UUCP> References: <8704190657.AA12796@cdfb.toronto.edu>, <1500@sphinx.uchicago.edu> Sender: info-apple-request@BRL.ARPA To: info-apple@BRL.ARPA >> 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? >> >> 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. This problem is easily overcome using basic. The key to it is understanding the error handling in the apple. The ONERR GOTO statement is not a conditional gosub statement. It does, although save the current program location. After the proper error correcting statements are executed in the error routine (in this case, the creation of a file) a RESUME command should be executed and not a RETURN. This will return to the point of the error where the error has been corrected. Hope this helps... paul nakada nakada@husc4.harvard.edu nakada@harvsc4.BITNET