How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values 
Author Message
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values

In the VFP 6 documentation on Filer.dll, it states:

The Filer form, Filer.scx, contains a user-defined method called GetTime
that demonstrates how you can determine the date and time a file was created
from the DateTime property.

This method does not exist in the specified form.

I have figured out how to convert the date portion to a VFP Date type, bit I
havent been successful in converting the Time portion.

Anyone know how?

TIA

Jory Liebman



Mon, 27 Jan 2003 03:00:00 GMT  
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values

He
use the Scripting FilesystemObject for all that stuff.
-Anders

Quote:

> In the VFP 6 documentation on Filer.dll, it states:

> The Filer form, Filer.scx, contains a user-defined method called GetTime
> that demonstrates how you can determine the date and time a file was
created
> from the DateTime property.

> This method does not exist in the specified form.

> I have figured out how to convert the date portion to a VFP Date type, bit
I
> havent been successful in converting the Time portion.

> Anyone know how?

> TIA

> Jory Liebman



Mon, 27 Jan 2003 03:00:00 GMT  
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values

Thanks for the reply.

I have had trouble using the FileSystemObject. Perhaps you can
elucidate.Otherwise, I'll write a C DLL for it

Jory


Quote:
> He
> use the Scripting FilesystemObject for all that stuff.
> -Anders




Quote:
> > In the VFP 6 documentation on Filer.dll, it states:

> > The Filer form, Filer.scx, contains a user-defined method called GetTime
> > that demonstrates how you can determine the date and time a file was
> created
> > from the DateTime property.

> > This method does not exist in the specified form.

> > I have figured out how to convert the date portion to a VFP Date type,
bit
> I
> > havent been successful in converting the Time portion.

> > Anyone know how?

> > TIA

> > Jory Liebman



Mon, 27 Jan 2003 03:00:00 GMT  
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values
Jory,
Here's some sample code (I may have even got it from Anders):
DO FILEDATES WITH "C:\AUTOEXEC.BAT"

*-------
*PROCEDURE Filedates
LPARAMETERS tcFilename
NOTE A fully qualified path + filename is required

ON ERROR DO Errorhandler WITH ERROR(), MESSAGE()

#DEFINE BS "\"
#DEFINE CR CHR(13)
#DEFINE DOT "."
LOCAL lnBackSlashes
LOCAL oCommand
LOCAL lcFile1, lcFile2, lcFile3
LOCAL ldDateCreated, ldDateLastModified, ldDateLastAccessed
STORE '' TO lcFile1, lcFile2, lcFile3
STORE {} TO ldDateCreated, ldDateLastModified, ldDateLastAccessed
lnBackSlashes = OCCURS ( BS , tcFilename)
lcFile1 = STRTRAN(LEFT(tcFilename, ;
    AT(BS,tcFilename,lnBackSlashes)-1), ;
    BS, [").SubFolders("]) ;
    + SUBSTR(tcFilename, AT(BS,tcFilename,lnBackSlashes )) ;
    + [")]
lcFile2= STRTRAN(lcFile1,BS, [").Files("] )
lcFile3 = STUFF(lcFile2,AT(DOT, lcFile2), 0, [.RootFolder] )
oCommand = [Drives("] + lcFile3
*? oCommand
oScr = CREATEOBJECT("scripting.filesystemobject")
ldDateLastModified = oScr.&oCommand..DateLastModified
ldDateCreated = oScr.&oCommand..DateCreated
ldDateLastAccessed = oScr.&oCommand..DateLastAccessed

MESSAGEBOX (tcFilename + CR + ;
 'written   ' + PADR(ldDateLastModified,20) +CR + ;
 'installed ' + PADR(ldDateCreated,20) + CR + ;
 'accessed  ' + PADR(ldDateLastAccessed,20) )
ON ERROR
ENDPROC

PROCEDURE Errorhandler (tnErrorNumber, tcErrorMessage)
MESSAGEBOX (STR(tnErrorNumber) + CHR(13) + tcErrorMessage)
RETURN
ENDPROC
* ----

Rick

Quote:

> Thanks for the reply.

> I have had trouble using the FileSystemObject. Perhaps you can
> elucidate.Otherwise, I'll write a C DLL for it

> Jory



> > He
> > use the Scripting FilesystemObject for all that stuff.
> > -Anders



> > > In the VFP 6 documentation on Filer.dll, it states:

> > > The Filer form, Filer.scx, contains a user-defined method called
GetTime
> > > that demonstrates how you can determine the date and time a file was
> > created
> > > from the DateTime property.

> > > This method does not exist in the specified form.

> > > I have figured out how to convert the date portion to a VFP Date type,
> bit
> > I
> > > havent been successful in converting the Time portion.

> > > Anyone know how?

> > > TIA

> > > Jory Liebman



Mon, 27 Jan 2003 03:00:00 GMT  
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values
Thanks Rick:

That's perfect.

Jory

Quote:
> Jory,
> Here's some sample code (I may have even got it from Anders):
> DO FILEDATES WITH "C:\AUTOEXEC.BAT"

> *-------
> *PROCEDURE Filedates
> LPARAMETERS tcFilename
> NOTE A fully qualified path + filename is required

> ON ERROR DO Errorhandler WITH ERROR(), MESSAGE()

> #DEFINE BS "\"
> #DEFINE CR CHR(13)
> #DEFINE DOT "."
> LOCAL lnBackSlashes
> LOCAL oCommand
> LOCAL lcFile1, lcFile2, lcFile3
> LOCAL ldDateCreated, ldDateLastModified, ldDateLastAccessed
> STORE '' TO lcFile1, lcFile2, lcFile3
> STORE {} TO ldDateCreated, ldDateLastModified, ldDateLastAccessed
> lnBackSlashes = OCCURS ( BS , tcFilename)
> lcFile1 = STRTRAN(LEFT(tcFilename, ;
>     AT(BS,tcFilename,lnBackSlashes)-1), ;
>     BS, [").SubFolders("]) ;
>     + SUBSTR(tcFilename, AT(BS,tcFilename,lnBackSlashes )) ;
>     + [")]
> lcFile2= STRTRAN(lcFile1,BS, [").Files("] )
> lcFile3 = STUFF(lcFile2,AT(DOT, lcFile2), 0, [.RootFolder] )
> oCommand = [Drives("] + lcFile3
> *? oCommand
> oScr = CREATEOBJECT("scripting.filesystemobject")
> ldDateLastModified = oScr.&oCommand..DateLastModified
> ldDateCreated = oScr.&oCommand..DateCreated
> ldDateLastAccessed = oScr.&oCommand..DateLastAccessed

> MESSAGEBOX (tcFilename + CR + ;
>  'written   ' + PADR(ldDateLastModified,20) +CR + ;
>  'installed ' + PADR(ldDateCreated,20) + CR + ;
>  'accessed  ' + PADR(ldDateLastAccessed,20) )
> ON ERROR
> ENDPROC

> PROCEDURE Errorhandler (tnErrorNumber, tcErrorMessage)
> MESSAGEBOX (STR(tnErrorNumber) + CHR(13) + tcErrorMessage)
> RETURN
> ENDPROC
> * ----

> Rick



- Show quoted text -

Quote:
> > Thanks for the reply.

> > I have had trouble using the FileSystemObject. Perhaps you can
> > elucidate.Otherwise, I'll write a C DLL for it

> > Jory



> > > He
> > > use the Scripting FilesystemObject for all that stuff.
> > > -Anders



> > > > In the VFP 6 documentation on Filer.dll, it states:

> > > > The Filer form, Filer.scx, contains a user-defined method called
> GetTime
> > > > that demonstrates how you can determine the date and time a file was
> > > created
> > > > from the DateTime property.

> > > > This method does not exist in the specified form.

> > > > I have figured out how to convert the date portion to a VFP Date
type,
> > bit
> > > I
> > > > havent been successful in converting the Time portion.

> > > > Anyone know how?

> > > > TIA

> > > > Jory Liebman



Mon, 27 Jan 2003 03:00:00 GMT  
 How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values

Hi
ofs=create('scripting.filesystemobject')
lcFile=getfile('jpg')
with ofs.getfile(lcFile)
? .path
? .datelastaccessed
? .datelastmodified
? .datecreated
? .attributes
? .size
Endwith

-Anders


Quote:
> He
> use the Scripting FilesystemObject for all that stuff.
> -Anders




Quote:
> > In the VFP 6 documentation on Filer.dll, it states:

> > The Filer form, Filer.scx, contains a user-defined method called GetTime
> > that demonstrates how you can determine the date and time a file was
> created
> > from the DateTime property.

> > This method does not exist in the specified form.

> > I have figured out how to convert the date portion to a VFP Date type,
bit
> I
> > havent been successful in converting the Time portion.

> > Anyone know how?

> > TIA

> > Jory Liebman



Tue, 28 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Converting an ,scx ,vcx TimeStamp to a datetime value

2. Filer.dll

3. VFP5 : FILER.DLL Registration

4. Filer.dll

5. VFP 5.0 : FILER.DLL

6. Filer, filer, where art thou ?

7. Problem for converting DateTime field to Date Field

8. Converting Datetime to Numeric Julian

9. VFP 6.0 problem with converting timestamp to datetime

10. DateTime converting to character string

11. VFP 6.0 and problem with converting timestamp to datetime

12. Select clause with datetime values

 

 
Powered by phpBB® Forum Software