//AB/ Project GetFileInformation //AB/ Object prj is a View_Project //AB/ Set Size to 567 936 //AB/ Set ProjectName to "GetFileInformation" //AB/ Set ProjectFileName to "GetFileInformation.vw" // Project Object Structure // oGetFileInformationView is a dbView // oFileMaskForm is a Form // oShowTimeAsLocalFileTimeCheckbox is a CheckBox // oExecuteButton is a Button // oFileInformationGrid is a Grid // Register all objects Register_Object oExecuteButton Register_Object oFileInformationGrid Register_Object oFileMaskForm Register_Object oGetFileInformationView Register_Object oShowTimeAsLocalFileTimeCheckbox //AB-StoreTopStart Use gFileDateTime.Pkg //AB-StoreTopEnd //AB-IgnoreStart Use dfClient.pkg Use Windows.pkg //AB-IgnoreEnd DEFERRED_VIEW Activate_oGetFileInformationView FOR ; ; Object oGetFileInformationView is a dbView Set Border_Style to Border_Thick Set Icon to "Default.Ico" Set Label to "Get File Information" Set Location to 2 2 Set Size to 200 405 //AB-DDOStart //AB-DDOEnd Object oFileMaskForm is a Form Set Label to "File mask:" Set Size to 13 337 Set Location to 6 57 Set peAnchors to anLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart // Set the default to "c:\windows" Procedure Activating String sCurrentPath Forward Send Activating Get Value To sCurrentPath If (sCurrentPath = "") Begin Set Value To "c:\windows\*.*" End End_Procedure // Activating //AB-StoreEnd End_Object // oFileMaskForm Object oShowTimeAsLocalFileTimeCheckbox is a CheckBox Set Label to "Show Local File Time" Set Size to 10 84 Set Location to 21 57 Set Status_Help to "If unchecked UTC is used" //AB-StoreStart //Fires whenever the value of the control is changed //Procedure OnChange // Boolean bChecked // // Get Checked_State To bChecked //End_Procedure // OnChange //AB-StoreEnd End_Object // oShowTimeAsLocalFileTimeCheckbox Object oExecuteButton is a Button Set Label to "Execute" Set Location to 21 344 Set peAnchors to anRight //AB-StoreStart // Take the value entered in the form as the filemask and pass it to // the directory read function. Procedure OnClick String sFilePath tFileDateTime[] FileInformation Boolean bUseLocalFileTime Get Value Of oFileMaskForm To sFilePath If (sFilePath = "") Begin Error DFERR_OPERATOR "Filepath cannot be empty" Procedure_Return End Get Checked_State Of oShowTimeAsLocalFileTimeCheckbox To bUseLocalFileTime Move (FileDateTime (sFilePath, bUseLocalFileTime)) To FileInformation Send DoFillGrid Of oFileInformationGrid (&FileInformation) End_Procedure // OnClick //AB-StoreEnd End_Object // oExecuteButton Object oFileInformationGrid is a Grid Set CurrentCellColor to clHighlight Set CurrentCellTextColor to clHighlightText Set CurrentRowColor to clHighlight Set CurrentRowTextColor to clHighlightText Set Size to 137 389 Set Location to 37 5 Set Highlight_Row_state to TRUE Set peResizeColumn to rcAll Set Line_Width to 4 0 Set Form_Width item 0 to 142 Set Header_Label item 0 to "Filename" Set Form_Width item 1 to 80 Set Header_Label item 1 to "Created" Set Form_Width item 2 to 80 Set Header_Label item 2 to "Accessed" Set Form_Width item 3 to 80 Set Header_Label item 3 to "Write" //AB-StoreStart Set Select_Mode To No_Select // Enumerate the contents of the array with fileinformation and place // the information in a grid. Procedure DoFillGrid tFileDateTime[] BYREF FileInformation Integer iElements iElement iItems iItem Set Dynamic_Update_State To False Send Delete_Data Move (SizeOfArray (FileInformation)) To iElements Decrement iElements For iElement From 0 To iElements Send Add_Item Msg_None FileInformation[iElement].sFileName Send Add_Item Msg_None FileInformation[iElement].dtCreated Send Add_Item Msg_None FileInformation[iElement].dtLastAccessed Send Add_Item Msg_None FileInformation[iElement].dtLastWrite Loop Get Item_Count To iItems Decrement iItems For iItem From 0 To iItems Set Entry_State Item iItem To False Loop Set Dynamic_Update_State To True End_Procedure // DoFillGrid //AB-StoreEnd End_Object // oFileInformationGrid CD_End_Object // oGetFileInformationView //AB-StoreStart //AB-StoreEnd //AB/ End_Object // prj