Andy Lacey
andy at minstersystems.co.uk
Thu Jul 3 08:16:16 CDT 2003
Hi Sander apiCopyFile may return 0 or 1 but the CopyFile function that you're looking at is correct in saying that IT returns nothing. The var Return has a value but for CopyFile to return a value it would require aline readong CopyFile = Return which it doesn't have. Andy Lacey http://www.minstersystems.co.uk > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Sad Der > Sent: 03 July 2003 13:40 > To: Acces User Group > Subject: [AccessD] apiCopyFile > > > Hi group, > > can someone please confirm the following? > I found the code below in an application I have te > maintain (is this the correct word?). > > The comments say that it doesn't return > anything...wich is bulls#@#. > > As I see it apiCopyFile returns zero or one. > Result Meaning > 0 Action Failed > 1 Action Success > > Is this correct? > > Regards, > > Sander > > > Declare Function apiCopyFile Lib "kernel32" Alias > "CopyFileA" _ > (ByVal lpExistingFileName As String, _ > ByVal lpNewFileName As String, _ > ByVal bFailIfExists As Long) As Long > > > Public Function CopyFile(SourceFile As String, > DestFile As String) > '--------------------------------------------------------------- > ' PURPOSE: Copy a file on disk from one location to > another. > ' ACCEPTS: The name of the source file and destination > file. > ' RETURNS: Nothing > '--------------------------------------------------------------- > > > Dim Result As Long > If Dir(SourceFile) = "" Then > MsgBox Chr(34) & SourceFile & Chr(34) & _ > " is not valid file name." > Else > Result = apiCopyFile(SourceFile, DestFile, > False) > End If > > End Function > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/a> ccessd > Website: > http://www.databaseadvisors.com >