{ "header": { "version": 1, "type": "record" }, "body": { "record1": { "<1>": "declare subroutine record_lock\r\ndeclare function msg\r\n$insert logical\r\n$insert quote_equ\r\n$insert msg_equates\r\n\r\nListId = 'QUOTE_ID*':@station\r\nQuoteKey = xlate( 'SYSLISTS', ListId, 1, 'X' )\r\nif QuoteKey then\r\n * check to see if open for this customer\r\n QuoteRec = xlate( 'QUOTE', QuoteKey, '', 'X' )\r\n CustNo = .cust_no->text\r\n WrongCust = false$\r\n ErrMsg = ''\r\n if QuoteRec <> CustNo then\r\n ErrMsg:= 'Quote ':QuoteKey:' is a quote for ':oconv( QuoteRec, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n ErrMsg:= ' not ':oconv( CustNo, '[XLATE_CONV,COMPANY*CO_NAME]' )\r\n WrongCust = true$\r\n end\r\n WrongStat = false$\r\n *if QuoteRec <> 'O' then\r\n * if ErrMsg then\r\n * ErrMsg:= ' and is not OPEN'\r\n * end else\r\n * ErrMsg:= 'Quote ':QuoteKey:' is not OPEN'\r\n * end\r\n * WrongStat = true$\r\n *end\r\n if ( WrongCust = false$ ) and ( WrongStat = false$ ) then\r\n .quote_num->text = QuoteKey\r\n\t open 'SYSLISTS' to SysListsTable else\r\n\t Void = msg( '', 'Unable to open SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t record_lock( SysListsTable, 'SysLists', ListId )\r\n\t delete SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to delete ':ListId:' from SYSLISTS...' )\r\n\t return 0\r\n\t end\r\n\t unlock SysListsTable, ListId else\r\n\t Void = msg( '', 'Unable to unlock SYSLISTS ':ListId )\r\n\t return 0\r\n\t end\r\n\tend else\r\n\t MsgInfo = ''\r\n\t MsgInfo = ErrMsg\r\n\t MsgInfo = '!'\r\n\t Void = msg( '', MsgInfo )\r\n\tend\r\nend\r\nRETURN 0" } } }