Re: File's date and time

 BBS: Inland Empire Archive
Date: 11-04-92 (08:44)             Number: 372
From: JON LEGER                    Refer#: NONE
  To: ROBERT CHURCH                 Recvd: NO  
Subj: Re: File's date and time       Conf: (2) Quik_Bas
RC> How do I get the date and time from the Dos DTA?  I've got the DTA structu
RC> and the FindFirst/FindNext routines, but how do I convert the bit-mapped t
RC> and date portions of the DTA structure to integers?  Thanks
RC>     [-=ROB=-]

Use the GetFileData (dta, File as FileDataType) sub.

TYPE FileDataType
     FileName as string * 12
     FileYear as integer
     FileMonth as integer
     FileDay as integer
     FileHour as integer
     FileSecond as integer
     FileAttrib as integer
     FileSize as integer

'Ok. You wanna find the date and time for MYFILE.TXT
'This is what you do.

'First set MyFile as FileDataType
DIM MyFile as FileDataType
'Second get the file's data
FindFirstFile "MYFILE.TXT",d$,r%
'Ok, now that that is done, get the file's information
GetFileData d$,MyFile

'That would get you all of 'MYFILE.TXT's information. Now all you have to
'do is print that information.

PRINT "File Name: "+MyFile.FileName
PRINT "File Date: "+MyFile.FileYear+"/"+MyFile.FileMonth+"/"+MyFile.FileDa
PRINT "File Time: "+MyFile.FileHour+":"+MyFile.FileMinute+":"+MyFile.FileS


Hope that helps.


....if not I'm sure some of those QB genious-type people could help you
out better. :)

--- Renegade v7-09 Beta
 * Origin: TELESiS BBS 409.721.9414 NEDERLAND, TX (1:3811/118)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET