{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare subroutine btree.extract, update_index, rlist, end_dialog\r\ndeclare function msg, key_sort, utility, fieldcount, ex_vm_rem\r\n$insert lsl_users_equ\r\n$insert msg_equates\r\n\r\nopen 'DICT.SPC_EVAL_FTIR' to DictSPCEvalFTIRTable else\r\n   Void = msg( '', 'Unable to open DICT.SPC_EVAL_FTIR...' )\r\n   return 0\r\nend\r\n\r\nSearchStr = ''\r\nDateTestedFrom  = .date_tested_from->text\r\nDateTestedThru  = .date_tested_thru->text\r\nShifts          = .shift->text\r\nToolNums        = .ftirnumber->text\r\nEvalRange       = .evalrange->text\r\nconvert @fm to @vm in Shifts\r\nconvert @fm to @vm in ToolNums\r\nconvert @fm to @vm in EvalRange\r\n\r\n\r\nif DateTestedFrom and DateTestedThru then\r\n    SearchStr<-1> = 'DATE_TESTED':@vm:DateTestedFrom:'...':DateTestedThru\r\nend else\r\n\tif DateTestedFrom then\r\n\t    SearchStr<-1> = 'DATE_TESTED':@vm:'>=':DateTestedFrom\r\n\tend\r\n\tif DateTestedThru then\r\n\t    SearchStr<-1> = 'DATE_TESTED':@vm:'<=':DateTestedThru\r\n\tend\r\nend\r\nif ( Shifts <> '' ) then\r\n   SearchStr<-1> = 'SHIFT':@vm:Shifts\r\nend\r\nif ( ToolNums <> '' ) then\r\n   SearchStr<-1> = 'TOOL_NUMBER':@vm:ToolNums\r\nend\r\nif ( EvalRange <> '' ) then\r\n   SearchStr<-1> = 'RANGE':@vm:EvalRange\r\nend\r\nif SearchStr then\r\n    SearchStr := @fm\r\n    Void = utility( 'CURSOR', 'H' )\r\n    * do a btree.extract\r\n    btree.extract( SearchStr, 'SPC_EVAL_FTIR', DictSPCEvalFTIRTable, Keys, '', Flag )\r\n    if Flag <> 0 then\r\n       Void = msg( '', 'Error while extracting SPC_EVAL_FTIR records...' )\r\n       return 0\r\n    end\r\n    if Keys then\r\n       convert @vm to @fm in Keys\r\n       Keys = key_sort( Keys, 'SPC_EVAL_FTIR', 'TOOL_NUMBER':@fm:'#DATE_TESTED':@fm:'#SHIFT', 1 )\r\n       end_dialog( @window, Keys )\r\n    end else\r\n       MsgInfo = ''\r\n       MsgInfo<mtext$> = 'No records found meeting your criteria...' \r\n       MsgInfo<micon$> = '!'\r\n       Void = msg( '', MsgInfo )\r\n    end\r\n    Void = utility( 'CURSOR', 'A' )\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<mtext$> = 'You have not entered any search criteria...' \r\n    MsgInfo<micon$> = '!'\r\n    Void = msg( '', MsgInfo )\r\nend\r\nreturn 0\r\n\r\n"
        }
    }
}