{ "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_REACTOR_PARTICLES' to DictSPCRPTable else\r\n Void = msg( '', 'Unable to open DICT.SPC_REACTOR_PARTICLES...' )\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\nReactors = .reactors->array\r\nReactors = ex_vm_rem( Reactors )\r\nconvert @fm to @vm in Shifts\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 ( Reactors <> '' ) then\r\n SearchStr<-1> = 'REACTOR':@vm:Reactors\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_REACTOR_PARTICLES', DictSPCRPTable, Keys, '', Flag )\r\n if Flag <> 0 then\r\n Void = msg( '', 'Error while extracting SPC_REACTOR_PARTICLES 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_REACTOR_PARTICLES', 'REACTOR':@fm:'#DATE_TESTED':@fm:'SHIFT', 1 )\r\n end_dialog( @window, Keys )\r\n end else\r\n MsgInfo = ''\r\n MsgInfo = 'No records found meeting your criteria...' \r\n MsgInfo = '!'\r\n Void = msg( '', MsgInfo )\r\n end\r\n Void = utility( 'CURSOR', 'A' )\r\nend else\r\n MsgInfo = ''\r\n MsgInfo = 'You have not entered any search criteria...' \r\n MsgInfo = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\nreturn 0\r\n\r\n" } } }