Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rutgers!cbmvax!vu-vlsi!swatsun!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: Repeat SetVol query Message-ID: <3273@carthage.cs.swarthmore.edu> Date: 31 Oct 89 20:14:49 GMT References: <3260@carthage.cs.swarthmore.edu> <2802@hub.UUCP> Reply-To: jackiw@carthage (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 59 In article <2802@hub.UUCP> 6600pete@hub.UUCP writes: > From article <3260@carthage.cs.swarthmore.edu>, by jackiw@cs.swarthmore.edu (Nick Jackiw): > > You can't SetVol(...) to the working directory returned by SFGetFile > > under HFS. > > Sure you can. I've done it lots. What error code are you getting back? > -------------------------------------------------------------------- > Pete Gontier, pete@cavevax.ucsb.edu; outgoing .UUCP addresses bounce No error. Just no results. Seems to me the following program, which calls SFGetFile thrice, should on the last instance bring up the GetFile dialog in the same directory/volume as a file was chosen in on the first instance. Got that? (Default:=SFGetfile1; RememberFirstDir:=Default; NewDefault:=SFGetFile2; SET_VOL(RememberFirstDir); now SFGetFile3. I'd think that SFGetFile3 would show up in RememberFirstDir, but it doesn't; it comes up in whatever Dir you left it in at the end of SFGetFile2. Here's the code: ------------------------- program SetVolTest; var where: point; types: SFTypeList; reply: SFReply; oldDir: integer; theErr: OSerr; begin types[0] := 'TEXT'; SetPt(where, 100, 150); SFGetFile(where, '', nil, 1, types, nil, reply); {Get first directory} oldDir := reply.vRefNum; {Remember its WDrefnum} SFGetFile(where, '', nil, 1, types, nil, reply); {Allow user to move to 2nd directory} theErr := SetVol(nil, oldDir); {Attempt to go back to first} SFGetFile(where, '', nil, 1, types, nil, reply) end. ------------------------- My lightbulb remains perpetually dim. Thanks for any assistance, Nick -- _ _|\____ Nick Jackiw | Visual Geometry Project | Math Department / /_/ O> \ ------------+-------------------------+ Swarthmore College | O> | 215-328-8225| jackiw@cs.swarthmore.edu| Swarthmore PA 19081 \_Guernica_/ ------------+-------------------------+ USA