Path: utzoo!attcan!uunet!wuarchive!psuvax1!swatsun!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: aus.mac,comp.sys.mac.programmer Subject: Re: Setting a Default Directory Message-ID: Date: 13 Aug 90 15:26:21 GMT References: <11240@wehi.dn.mu.oz> Reply-To: jackiw@cs.swarthmore.edu (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 41 JON@wehi.dn.mu.oz (Jon Eaves) writes: > I want to set > the default volume and directory using a 'STR ' resource containing the > full pathname. > I've read most of IM IV Ch 14, and IM II Ch 4 but they have > provided no joy. > Extracting the 'STR ' stuff was a gimmie, I have the Pascal format > string stored in a Str255 waiting to be used. The string is of the format > 'DriveName:FolderName' I have tried numerous calls to SetVol and PBHSetVol, > none of which to do any good, but return noErr. Try: var aStr:StringHandle; begin aStr:=GetString(stringID); if aStr<>nil then begin if SetVol(aStr^,0)=noErr then begin ... end else error end else error end; If this doesn't work, try taking a colon on the end of the STR in your resource file. Perhaps you're being bitten by an assumption that got me the first time I tried this. The default directory is *not* the directory which appears by default when you do SFGetFile or SFPutFile. There are low-memory globals which deal with this; ask for details if this is the case. > Jon Eaves -- +-------------------+-jackiw@cs.swarthmore.edu / !rutgers!bpa!swatsun!jackiw-+ | nicholas jackiw | jackiw%campus.swarthmore.edu@swarthmr.bitnet | +-------------------+-VGP/MathDept/Swarthmore College, Swarthmore, PA 19081--+ "Ah...I've got this CHRONIC pain." _True Believer_