{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function fieldcount, msg, next_key, start_window\r\n$insert reactor_log_equ\r\n$insert logical\r\n$insert msg_equates\r\n\r\nLLInfo    = .ll_info->array\r\nReactors  = LLInfo<1>\r\nStartDate = LLInfo<2>\r\nStartTime = LLInfo<3>\r\nEndDate   = LLInfo<4>\r\nEndTime   = LLInfo<5>\r\nRcnt = fieldcount( Reactors, @vm )\r\nif ( Rcnt > 0 ) then\r\n\topen 'REACTOR_LOG' to RLTable else\r\n\t    Void = msg( '', 'Unable to open REACTOR_LOG...' )\r\n\t    return 0\r\n\tend\r\n    CurDate = date()\r\n    CurTime = time()\r\n    EntryId = @user4\r\n    RlKeys  = ''\r\n    for i = 1 to Rcnt\r\n        ThisReactor = Reactors<1,i>\r\n        if ThisReactor <> '' then\r\n\t    \tNextRLKey = next_key( 'REACTOR_LOG', RLTable, 'NEXT', '' )\r\n\t\t\tRLRec = ''\r\n\t\t\tRLRec<reactor_log_start_date$>    = iconv( StartDate<1,i>, 'D' )\r\n\t\t\tRLRec<reactor_log_start_time$>    = iconv( StartTime<1,i>, 'MT' )\r\n\t\t\tRLRec<reactor_log_end_date$>      = iconv( EndDate<1,i>, 'D' )\r\n\t\t\tRLRec<reactor_log_end_time$>      = iconv( EndTime<1,i>, 'MT' )\r\n\t\t\tRLRec<reactor_log_reactor$>       = ThisReactor\r\n\t\t\tRLRec<reactor_log_category$>      = 'M' ;* for maintenance\r\n\t\t\tRLRec<reactor_log_entry_id$>      = EntryId\t\t\r\n\t\t\tRLRec<reactor_log_entry_date$>    = CurDate\r\n\t\t\tRLRec<reactor_log_react_prob_id$> = 158 ;* preventitive maintenance\r\n\t\t\tRLRec<reactor_log_react_serv_id$> = 188 ;* service for leak and lamp\r\n\t\t\tRLRec<reactor_log_scheduled$>     = 1\r\n\t\t\twrite RLRec on RLTable, NextRLKey else\r\n\t\t\t    void = msg( '', 'Unable to write ':NextRLKey:' on REACTOR_LOG...' )\r\n\t\t\t    return 0\r\n\t\t\tend\r\n\t\t\tunlock RLTable, NextRLKey else\r\n\t\t\t    Void = msg( '', 'Unable to unlock ':NextRLKey:' on REACTOR_LOG...' )\r\n\t\t\t    return 0\r\n\t\t\tend\r\n\t\t\tVoid = next_key( 'REACTOR_LOG', RLTable, 'UPDATE', NextRLKey )\r\n\t        RlKeys<1,-1> = NextRLKey\t\t\r\n        end\r\n    next i\r\n\t.reactors->text = ''\r\n\tCleanArray = str( @vm, 6 ):@fm:str( @vm, 6 ):@fm:str( @vm, 6 ):@fm:str( @vm, 6 ):@fm:str( @vm, 6 )\r\n\t.ll_info->array = CleanArray\r\n    if RlKeys <> '' then\r\n       MsgInfo = ''\r\n       MsgInfo<mtext$> = 'Do you wish to view the entrie(s)...'\r\n       MsgInfo<mtype$> = 'BNY'\r\n       MsgInfo<micon$> = '?'\r\n       Resp = msg( '', MsgInfo )\r\n       if Resp then\r\n\t\t  Void = start_window( 'REACTOR_LOG', '', RlKeys:'*CENTER', '', '' )\r\n       end\r\n    end\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<mtext$> = 'You must select at least one reactor...'\r\n    MsgInfo<micon$> = 'H'\r\n    Void = msg( '', MsgInfo )\r\nend\r\nRETURN 0"
        }
    }
}