Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
method getFileCreateDate( strFileName String ) Datetime
; -------------------------------------------------------------------
; When passed a fully qualified filename, this returns the file's
; creation date, as opposed to the last modified date. Note: This
; returned blankDate() as an error condition.
;
; Note that this was written using Paradox 9 under Windows 2000.
; Test heavily if using this under other versions of Windows,
; especially Windows 9.x.
; -------------------------------------------------------------------
var
strFileTime,
strLineData,
strTempFile String
astrTokens Array[] String
ts TextStream
dtResult DateTime
endVar
dtResult = blank()
strTempFile = "c:\\importme.txt"
; First, get the creation date of the target file into something
; we can work with. Use "cmd" for Win 2K, NT, XP or
; "command" for Win 9.x/ME.
execute( "cmd /c dir /tc " + strFileName +
" > " + strTempFile,
ExeHidden + ExeMinimized )
; import those results and parse out the tokens.
ts.open( strTempFile, "r" )
; Note we're skipping several lines deliberately. You may
; need to fiddle with this, as the data can change between
; different versions of Windows.
ts.readLine( strLineData )
ts.readLine( strLineData )
ts.readLine( strLineData )
ts.readLine( strLineData )
ts.readLine( strLineData )
ts.readLine( strLineData )
ts.close()
strLineData.breakApart( astrTokens ) ; parse the line
; Massage time into a convertable value
strFileTime = astrTokens[ 2 ]
strFileTime = strFileTime.substr( 1, 5 ) + ":00 " +
strFileTime.subStr( 6, 1 ) + "m"
; construct the return value
dtResult = dateTime( dateVal( astrTokens[ 1 ] ) ) +
dateTime( time( strFileTime ) )
return dtResult
endMethod
method pushButton(var eventInfo Event)
var
dtCreateDate Datetime
strFileNname String
endVar
strFileName = "c:\\nospampls.txt"
dtCreateDate = getFileCreateDate( strFileName )
if dtCreateDate = blank() then
msgStop( "Sorry", "We can't get the creation date for " +
strFileName + ". Please try again." )
else
msgInfo( "FYI", strFileName + " was created on " +
string( dtCreateDate ) + "." )
endIf
endMethod
HH:MM:SS am
HH:MM:SS pm