compile subroutine wo_daily_valid(ConvType, DataIo, Branch, ReturnedValue) $insert logical $insert quote_equ $insert msg_equates $insert wo_log_equ declare function msg, get_property, set_property, fieldcount declare subroutine extract_si_keys equ valid$ to 0 ;* successful equ invalid_msg$ to 1 ;* bad data - print error message window equ invalid_conv$ to 2 ;* bad conversion - " " equ invalid_nomsg$ to 3 ;* bad but do not print the error message window equ CrLf$ to char(13):char(10) ReturnedValue = DataIo status() = Valid$ * BEGIN CASE CASE ConvType = 'ICONV' * Maintaining the two following comments. Still too good to toss - JRO Also want to note that this here limits us to 6 characters in a WO * Keep this comment from Bryce, the code is gone but the comment is to good to toss... * check number of seperate layers - god this fucking layering keeps haunting me. WONo = '' WOStepKey = '' Bad = false$ CONVERT '.' TO '' IN DataIo IF NUM( DataIo ) THEN IF LEN(DataIo) = 7 THEN WONo = DataIo[1,6]:'.':DataIo[7,1] WOStepKey = DataIo[1,6]:'*':DataIo[7,1] END ELSE WONo = DataIo WOStepKey = DataIo:'*1' END IF RowExists('WO_STEP',WOStepKey) THEN WOCustNo = XLATE('WO_LOG',WONo[1,6],WO_LOG_CUST_NO$,'X') ReturnedValue = WONo:' ':XLATE( 'COMPANY', WOCustNo, 'ABBREV_OR_CO_NAME', 'X' ) END ELSE Bad = true$ END END ELSE Bad = true$ END IF Bad THEN MsgInfo = '' MsgInfo = DataIo:' is not a valid Work Order...' MsgInfo = '!' * let it be valid just warn Void = msg( '', MsgInfo ) status() = invalid_nomsg$ END CASE ConvType = 'OCONV' ReturnedValue = DataIo CASE otherwise$ ReturnedValue = '' status() = invalid_conv$ END CASE RETURN