[futurebasic] FB^3 File Function

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Mark Arnold <mda515t@...>
Date: Tue, 5 Oct 1999 09:03:26 -0500
Can someone give me some direction on what I need to do to rewrite this for
FB^3. There are a couple of issues I'm aware of. First, I know that you
can't dim things before the local function. The other is that FN CATMOVE is
not defined. There is an FSpCatMove that is defined, but it takes two longs
(an fspec for the source and destination folders) and I'm not sure how to
set this up. I'd appreciate any pointers. (Is there a demo or tutorial
available explaining how to do file stuff using just toolbox calls? I'm
using a mixture of FB and toolbox calls and am thoroughly confused.)

DIM MovePBRec.128, osErr%
DIM SrcVolRefNum%, SrcDirID&, 63 SrcFileName$
DIM DstVolRefNum%, DstDirID&, 63 DstFolderName$
LOCAL FN Move1File (SrcWDRefNum%, SrcFileName$, DstWDRefNum%, DstFolderName$)
'modified from a function by Rick Brown

osErr% = FN GetWDDirID (SrcWDRefNum%, SrcVolRefNum%, SrcDirID&)
LONG IF osErr% = _NoErr
osErr% = FN GetWDDirID (DstWDRefNum%, DstVolRefNum%, DstDirID&)
LONG IF osErr% = _NoErr
LONG IF SrcVolRefNum% = DstVolRefNum%
MovePBRec.ioNamePtr&   =@SrcFileName$
MovePBRec.ioVRefNum%   = SrcVolRefNum%
MovePBRec.ioDirID&     = SrcDirID&
MovePBRec.ioNewName&   =@DstFolderName$
IF DstFolderName$ = "" THEN MovePBRec.ioNewName& = _nil
MovePBRec.ioNewDirID&  = DstDirID&
osErr% = FN CATMOVE (@MovePBRec)'*** after-FB 2.07 ***
osErr% = _BadMovErr
END FN = osErr%