{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function security_check, set_printer, get_printer, msg, fieldcount, popup,Printer_Select\r\ndeclare subroutine security_err_msg\r\n\r\n$insert security_rights_equ\r\n$insert oiprint_equates\r\n$insert msg_equates\r\n$insert popup_equates\r\n\r\nequ Mon$   to 1\r\nequ Tue$   to 2\r\nequ Wed$   to 3\r\nequ Thurs$ to 4\r\nequ Fri$   to 5\r\nequ Sat$   to 6\r\nequ Sun$   to 7\r\n\r\nReselect:\r\n\r\nMastSchedPrintOptsPopup = xlate( 'SYSREPOSPOPUPS', @appid<1>:'**WO_MAST_SCHED_PRINT_OPTS', '', 'X' )\r\n\r\n*Display = MastSchedPrintOptsPopup<pdisplay$>\r\n\r\nDisplay = .sched_info->label\t\t\t;* List of 31 dates displayed at the top of the schedule\r\nconvert @fm to @vm in Display\r\n\r\nMastSchedPrintOptsPopup<pdisplay$> = Display\r\n\r\nSelDates = popup( @window, MastSchedPrintOptsPopup )\t\t;* Returns positions of selected dates in the list of 31\r\n\r\nSelDtCnt = fieldcount( SelDates, @vm )\r\nif SelDtCnt else\r\n   return 0\r\nend\r\n\r\nif SelDtCnt > 7 then\r\n   MsgInfo = ''\r\n   MsgInfo<mtext$> = 'You may only choose 7 days to print at a given time.'\r\n   MsgInfo<micon$> = 'H'\r\n   Void = msg( '', MsgInfo )\r\n   goto ReSelect\r\nend\r\n**\r\n\r\nPrintPath = Printer_Select('',1)\t\t;* Get default printer path\r\nStat = set_printer( 'INIT', '', '', '':@fm:'':@fm:0:@fm:'', 1,'',PrintPath )\r\ngosub CheckErr\r\n\r\nFont = \"Courier New,12,L,1\"\r\nconvert ',' to @fm in Font\r\nTfont = Font\r\nStat = set_printer( 'FONT', Font )\r\ngosub CheckErr\r\n\r\ngosub PrintToF\r\n\r\nFont<2> = 9\r\nFont<4> = 0\r\nVoid = set_printer( 'FONT', Font )\r\ngosub CheckErr\r\n\r\nVoid = set_printer( 'TEXT', '' )\r\n\r\n**\r\n\r\n\r\n\r\nSInfo\t\t= .sched_info->array\r\nColHeads \t= .sched_info->label\r\n\r\nconvert @fm to @vm in ColHeads\r\n\r\nNewColHeads = ''\r\n\r\nfor I = 1 to SelDtCnt\r\n   NewColHeads<1,-1> = ColHeads<1,SelDates<1,I>>\r\nnext I\r\n\r\nTable = ''\r\nTable<1> = 'R#':@vm:NewColHeads\r\n\r\nRcnt = fieldcount( SInfo<1>, @vm )\r\n\r\nTFont<2> = 9\r\nStat = set_printer( 'FONT', TFont )\r\n\r\nfor i = 1 to Rcnt\r\n   Tvar = trim(SInfo<SelDates<1,1>,i>):trim(SInfo<SelDates<1,2>,i>):trim(SInfo<SelDates<1,3>,i>):trim(SInfo<SelDates<1,4>,i>):trim(SInfo<SelDates<1,5>,i>):trim(SInfo<SelDates<1,6>,i>):trim(SInfo<SelDates<1,7>,i>)\r\n   \r\n   \r\n   \r\n   if Tvar = '|||||||' or Tvar = '||||||' then \r\n   \t\r\n      * Tom puts a '|' when not in use and if it is not in use for all 7 days then don't print\r\n   end else\r\n      Table<-1> = i:@vm:SInfo<SelDates<1,1>,i>:@vm:SInfo<SelDates<1,2>,i>:@vm:SInfo<SelDates<1,3>,i>:@vm:SInfo<SelDates<1,4>,i>:@vm:SInfo<SelDates<1,5>,i>:@vm:SInfo<SelDates<1,6>,i>:@vm:SInfo<SelDates<1,7>,i>\r\n   end\r\nnext i\r\n\r\nColTableInfo = '>+360':@vm:'<+2044':@vm:'<+2044':@vm:'<+2044':@vm:'<+2044':@vm:'<+2044':@vm:'<+2044':@vm:'<+2044'\r\nx = Set_Printer(\"ADDTABLE\", ColTableInfo, '', Table, '', '', 1, TB_ALL)\r\nstat = set_printer( 'TERM' )       \r\ngosub CheckErr   \r\n\r\nRETURN 0\r\n*===========================================================================*\r\nPrintTof:\r\n   TFont<1> = 24\r\n   TFont<3> = 'C'\r\n   Stat = set_printer( 'FONT', TFont )\r\n   LineOut = ''\r\n   LineOut = 'Reactor Master Scheduler'\r\n   Void = set_printer( 'TEXT', LineOut )   \r\n   TFont<1> = 16   \r\n   Stat = set_printer( 'FONT', TFont )   \r\n   LineOut = 'For the month of ':.month->text\r\n   Void = set_printer( 'TEXT', LineOut )\r\n   Void = set_printer( 'TEXT', '' )\r\n   Stat = set_printer( 'FONT', Font )   \r\nreturn \r\n\r\n*===========================================================================*\r\nCheckErr:\r\n    if stat < 0 then\r\n        goto FatalExit\r\n    end\r\nreturn \r\n\r\n*===========================================================================*\r\nFatalExit:\r\n    Void = msg( '', Stat )\r\n    Stat = set_printer( 'TERM' )\r\nreturn \r\n\r\n*===========================================================================*\r\n"
        }
    }
}