{
    "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.NDA' to DictNDATable else\r\n   Void = msg( '', 'Unable to open DICT.NDA...' )\r\n   return 0\r\nend\r\n\r\nSearchStr = ''\r\nInitDateFrom  = .init_date_from->text\r\nInitDateThru  = .init_date_thru->text\r\nExpDateFrom   = .exp_date_from->text\r\nExpDateThru   = .exp_date_thru->text\r\nCustIds       = .customer_info->array<1>\r\nActive        = .active_check->check\r\nInActive      = .inactive_check->check\r\n\r\nCustIds = ex_vm_rem( CustIds )\r\n\r\nif InitDateFrom and InitDateThru then\r\n    SearchStr<-1> = 'INIT_DATE':@vm:InitDateFrom:'...':InitDateThru\r\nend else\r\n\tif InitDateFrom then\r\n\t    SearchStr<-1> = 'INIT_DATE':@vm:'>=':InitDateFrom\r\n\tend\r\n\tif InitDateThru then\r\n\t    SearchStr<-1> = 'INIT_DATE':@vm:'<=':InitDateThru\r\n\tend\r\nend\r\nif ExpDateFrom and ExpDateThru then\r\n    SearchStr<-1> = 'EXP_DATE':@vm:ExpDateFrom:'...':ExpDateThru\r\nend else\r\n\tif ExpDateFrom then\r\n\t    SearchStr<-1> = 'EXP_DATE':@vm:'>=':ExpDateFrom\r\n\tend\r\n\tif ExpDateThru then\r\n\t    SearchStr<-1> = 'EXP_DATE':@vm:'<=':ExpDateThru\r\n\tend\r\nend\r\nif CustIds <> '' then\r\n    SearchStr<-1> = 'CUST_ID':@vm:CustIds\r\nend\r\nStatusVar = ''\r\nif Active then\r\n    StatusVar<1,-1> = 'A'\r\nend\r\nif InActive then\r\n    StatusVar<1,-1> = 'I'\r\nend\r\nif StatusVar then\r\n   SearchStr<-1> = 'STATUS':@vm:StatusVar\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, 'NDA', DictNDATable, Keys, '', Flag )\r\n    if Flag <> 0 then\r\n       Void = msg( '', 'Error while extracting NDA 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, 'NDA', 'CUST_NAME':@fm:'#INIT_DATE', 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"
        }
    }
}