PA_GetResourceTimeStamp

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetResourceTimeStamp (resFile; kind; resID) long

ParameterTypeDescription
resFileshortFile reference number of the file to access
kindunsigned longKind (4 Bytes type) of resource to access
resIDshortUnique resource ID
Function resultlongTimeStamp of the resource (number of seconds
since midnight, January 1, 1904)

Description

The routine PA_GetResourceTimeStamp returns the internal time-stamp of the resource type kind and the unique ID resID in the file referenced by resFile.

Each time a resource is created or modified, 4th Dimension stores a long corresponding to the date and time it is created/modified.

The returned value is the number of seconds since midnight, January, 1, 1904.

Under MacOS (or Windows+Altura), this long is obtained using GetDateTime. The values can then be extracted using SecondsToDate. Under Windows, some calculations will probably be necessary.

Example

Under MacOS or Windows+Altura, do something if the resources have been modified since June 25, 2000.

   DateTimeRec   dtr;
   unsigned long   secs;

   secs = (unsigned long) PA_GetResourceTimeStamp(resFile, 'toto', 128);
   SecondsToDate(secs, &dtr);
   if( (dtr.day > 25) && (dtr.month > 6) && (dtr.year > 2000) )
   {
   /* . . . resource modified since this date . . . */
   }

See Also

No reference.

Error Handling

Use PA_GetLastError to see if an error occurred


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next