Use DataDict.pkg Open c_Props Class cC_PropsDataDictionary is a DataDictionary //------------------------------------------------------ // // Function : pStandard_Time // // Scope : Private // // Parameters : Integer iFieldNum // The number of the field that is having it's value validated. // String sFieldVal // The value of the field that is being validated. // // Returns : Integer // zero if validation passed, or the error number if validation failed. // // Purpose : To validate the value of a time field, and ensure that the string is padded with zeros if the length was < 4. // // Notes : Minimum value is "0000" and maximum is "2359". // //------------------------------------------------------ Function pStandard_Time Integer iFieldNum String sFieldVal Returns Integer Integer iRetVal iFileNum String sError sErrorFile sErrorField // Min Time 00:00 // Max Time 23:59 Get Main_File to iFileNum Get_Attribute DF_FILE_DISPLAY_NAME of iFileNum to sErrorFile Get Field_Label iFieldNum DD_Label_Long to sErrorField If ((Length(sFieldVal)) = 0) Move "0000" to sFieldVal Else If ((Length(sFieldVal)) = 1) Move (sFieldVal+"000") to sFieldVal Else If ((Length(sFieldVal)) = 2) Move (sFieldVal+"00" ) to sFieldVal Else If ((Length(sFieldVal)) = 3) Move (sFieldVal+"0" ) to sFieldVal Set Field_Changed_Value iFieldNum to sFieldVal If (((Mid(sFieldVal,1,3)) > 5) or ((Mid(sFieldVal,2,1)) > 23)) Begin Move ("\n"+"\n"+"File: "+(String(iFileNum))+" - "+(String(sErrorFile))+"\n"+"Field: "+(String(iFieldNum))+" - "+(String(sErrorField))) to sError Error 15 sError Move 1 to iRetVal End Function_Return iRetVal End_Function Procedure Construct_Object Forward Send Construct_Object Set Main_file to c_Props.File_Number Set Foreign_Field_Option DD_KEYFIELD DD_NOPUT to True Set Foreign_Field_Option DD_KEYFIELD DD_FINDREQ to True Set Foreign_Field_Option DD_INDEXFIELD DD_NOPUT to True Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to True Set Field_Checkbox_Values Field c_Props.phadeLunchTime to "Y" "N" Set Field_Checkbox_Values Field c_Props.ShorterLastDay to "Y" "N" Set Field_Mask Field c_Props.WkDayStartTime to "##:##" Set Field_Validate_msg Field c_Props.WkDayStartTime to (RefFunc(pStandard_Time)) Set Field_Mask Field c_Props.WkDayEndTime to "##:##" Set Field_Validate_msg Field c_Props.WkDayEndTime to (RefFunc(pStandard_Time)) Set Field_Mask Field c_Props.LunchStartTime to "##:##" Set Field_Validate_msg Field c_Props.LunchStartTime to (RefFunc(pStandard_Time)) Set Field_Mask Field c_Props.LunchEndTime to "##:##" Set Field_Validate_msg Field c_Props.LunchEndTime to (RefFunc(pStandard_Time)) Set Field_Mask Field c_Props.LastWkDayEndTim to "##:##" Set Field_Validate_msg Field c_Props.LastWkDayEndTim to (RefFunc(pStandard_Time)) End_Procedure End_Class