Jose's Read Only Forum 2023

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Windows Script Runtime => Source Code => Scripting => FileSystemObject => Topic started by: José Roca on July 14, 2008, 04:18:59 AM

Title: IFile.DateCreated Property
Post by: José Roca on July 14, 2008, 04:18:59 AM


The following code illustrates the use of the DateCreated property with a file:

JScript


function ShowFileInfo(filespec)
{
   var fso, f, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFile(filespec);
   s = "Created: " + f.DateCreated;
   return(s);
}


VBScript


Function ShowFileInfo(filespec)
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   ShowFileInfo = "Created: " & f.DateCreated
End Function


PowerBASIC


FUNCTION ShowFileInfo (BYVAL filespec AS STRING) AS STRING

   LOCAL fso AS IFileSystem
   LOCAL f AS IFile
   
   fso = NEWCOM "Scripting.FileSystemObject")
   f = fso.GetFile(UCODE$(filespec))
   FUNCTION = "Created: " & PB_VariantDateToString(f.DateCreated)

END FUNCTION