Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uwm.edu!rpi!bu.edu!m2c!umvlsi!dime!lee From: lee@quincy.cs.umass.edu (Peter &) Newsgroups: comp.sys.mac.hypercard Subject: Re: save stack as Message-ID: Date: 4 Feb 91 19:48:29 GMT References: <4646@mindlink.UUCP> <1991Feb4.054700.2881@fennel.cc.uwa.oz.au> Sender: news@dime.cs.umass.edu Organization: The Software Development Lab at the University of Massachusetts at Amherst Lines: 54 In-reply-to: n_hays@fennel.cc.uwa.oz.au's message of 3 Feb 91 21:47:00 GMT In article <1991Feb4.054700.2881@fennel.cc.uwa.oz.au> n_hays@fennel.cc.uwa.oz.au writes: From: n_hays@fennel.cc.uwa.oz.au Newsgroups: comp.sys.mac.hypercard Date: 3 Feb 91 21:47:00 GMT References: <4646@mindlink.UUCP> Organization: University of Western Australia In article <4646@mindlink.UUCP>, John_Miller@mindlink.UUCP (John Miller) writes: > John Kevin Calhoun writes >> The "save" command in HyperCard 2.0 does what you want. Examples: >> > save this stack as "Fred" >> save stack "Template" as "The stack I'm going to work with" > > A problem with the "save stack" command is that it fails > if the a file already exists with the name given. There > doesn't seem to be any magical keywords such as "with > overwrite" or "with extreme prejudice" to cause it to > overwrite a file that already exists > > ---------------------------------------------------------------------- > John Kevin Miller (604) 433-1795 > Symplex Systems AppleLink (rarely) CDA0461 > Burnaby, British Columbia Fax: (604) 430-8516 > Canada usenet: john_miller@mindlink.uucp > ---------------------------------------------------------------------- Sounds like what you might need is the "File Exists" XFCN. As the name suggests it tests whether or not a file exists given a full pathname. You could then quizz the user in Hypertalk as to whether or not they want to overwrite the file and use one of the various "delete file" XCMD's if they do, or just automatically add a "1" to the name otherwise. "FileExists" is a part of the Support Tools eXternals 1.2.5 package which (I think?) is available on apple.com. Neale **************************************************************************** Neale Hays n_hays@fennel.cc.uwa.oz.au The University of Western Australia **************************************************************************** I don't think this XFCN is necessary in HC 2.0 -- you should be able to say: if there is a stack "blah" then ... -- |- Peter E. Lee, Staff Assistant -| | Software Development Lab at the University of Massachusetts at Amherst | | lee@cs.umass.edu or Fuligin@umass.bitnet or (413) 256-1329 | "When you expect whistles, it's flutes. When you expect flutes, it's whistles"