[futurebasic] Re: [FB] Folder vs File Alias

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2001 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Tue, 14 Aug 2001 01:42:16 -0400
>Is there anything that one must do differently when creating an Alias for a
>folder, vs an alias for a file?


Uh, yes.. the InName$ needs to be ""

:)

Thanks Rick Brown, and BowerBird's Textbook archive.

Sorry for a false start.

I seem to have it all working now.

Somebody asked if I could implement a "bookmark" feature for a viewed
folder in Slide Freebie, like one in Pictacular.

Doing that was easy, and glorious to see in operation, but I figured what
might be handier would be a Viewmarker file that can be placed anywhere you
want to point to any folder desired.

Works nifty.

Somebody help me come up with a different name as cool as Slide Freebie,
that I can charge for. :) It is getting too deluxe.

RC


>Here is what I am trying to do...
>
>I am saving a bookmark file.
>
>fName$ = Files$(_fSave,"Save ViewMark as...","Viewmarker",vRefNum%)
>
>Then I create it with:
>//(this is the only way I know how to get  resource fork installed with
>this type of file thing..
>
>CLEAR LOCAL MODE
>DIM 128 paramBlock$ 'paramblock used with file create
>LOCAL FN openNewRCFile (Filename$,volRefNum%)'pass the volume number
>DIM OSerr, ResFileRef%
>&@paramBlock$+_ioNamePtr, @Filename$
>%@paramBlock$+_ioVrefNum, volRefNum%
>OSerr = FN DELETE(@paramBlock$) 'delete the file now!
>OSerr = FN SETVOL(@paramBlock$) 'set vol into paramBlock
>CALL CREATERESFILE(Filename$) 'create the resource file
>&@paramBlock$+_ioNamePtr, @Filename$'set the filename into it
>OSerr = FN GETFILEINFO  (@paramBlock$)'get other info now
>&@paramBlock$+_ioFlUsrWds+_fdCreator,_"SFrb"'set file type and creator
>&@paramBlock$+_ioFlUsrWds+_fdType   ,_"View"
>OSerr = FN SETFILEINFO  (@paramBlock$)'set params to file
>'
>ResFileRef% = 0
>LONG IF OSerr = _NoErr 'did an error occur?
>ResFileRef% = FN OPENRFPERM(Filename$, volRefNum%,0)'open its resource fork
>XELSE
>ResFileRef% = -1
>END IF
>
>END FN = ResFileRef%
>
>
>Then I resolved that file's VolRefNum to the folder it is in with
>
>FolRef% = FOLDER("",vRefNum%)
>
>Followed by:
>FolName$ = FN GetFolderName$(FolRef%  , 0)  To get the Name of the folder
>it is in.
>
>That works fine. Making the alias does not.
>
>Actually I am using a version of PG's fn I call FN
>CreateXAlias(inName$,inVrefNum%,resID,resRef%)
>
>I ship the ResRefNum from above, the inName$ of the Folder name I got, and
>the inVrefNum% from the FOLDER statement and an ID of 128.
>
>I get a -43 error, meaning the target was not resolved correctly.
>
>
>??
>
>RC
>
>CLEAR LOCAL
>DIM fSpec;0,fVRefNum,fParID&,63 fName$
>LOCAL FN CreateXAlias(inName$,inVrefNum%,resID,resRef%)// Alias in External
>ResRef
>'~'
>DIM makeAlias,@fromFile,@aHndl&
>
>fName$ = inName$
>fVRefNum = inVrefNum%
>fromFile = 0
>fParID& = FN getParID(fName$,fVRefNum)
>LONG IF FN NEWALIAS(fromFile,fSpec,aHndl&)
>makeAlias = _fnfErr
>XELSE
>FN pMyGreplaceXRes(aHndl&,_"alis",resID,fName$,resRef%)
>makeAlias = _noErr
>END IF
>END FN = makeAlias
>
>
>
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>