11 lines
9.3 KiB
JSON
11 lines
9.3 KiB
JSON
{
|
|
"header": {
|
|
"version": 1,
|
|
"type": "record"
|
|
},
|
|
"body": {
|
|
"record1": {
|
|
"<1>": "declare function msg, send_event, admin_user, center_window, post_event\r\ndeclare function rowexists, fieldcount\r\ndeclare subroutine end_dialog\r\n$insert msg_equates\r\n$insert rpt_cfg_equ\r\n$insert rlist_equates\r\n$insert logical\r\n$insert exports_equ\r\n\r\nReportID = .report_id->Text\r\n\r\nif ReportID = '' then\r\n Void = post_event( @window:'.REPORT_ID', 'GOTFOCUS' )\r\n Return 0\r\nend\r\n\r\n*Get the last report ID so can restore if new selection fails.\r\nReportIDLast = .report_id_last->text\r\n\r\nLockSwt = 1\r\n*If this one has already been loaded then do not try to lock it again!\r\nif ReportID = ReportIDLast Then LockSwt = 0\r\n\r\narrayinfo = ''\r\n\r\nif Admin_user( @user4 ) then \r\n open 'CONFIG' to ConfigTable else\r\n\t Void = msg( '', 'Unable to open CONFIG table' )\r\n\t end_dialog( @window, '' )\r\n\t return 0\r\n end\r\n LockErr = 0\r\n LockID = ReportID\r\n If LockSwt Then GoSub LockRecord\r\n If LockErr Then\r\n Ans = msg('', 'CAN NOT LOCK CONFIG RECORD ':ReportID:'... ABORTING!' )\r\n return 0\r\n end\r\n\r\n *At this point the record should be locked. \r\n *Now read it in for loading to the form.\r\n read ReportRecord from ConfigTable,ReportID Then\r\n GoSub LoadRecord\r\n *OK, Record has been loaded to screen. \r\n * Now take care to Unlock the last Report ID (if there was one).\r\n if ReportIDLast Then\r\n *Had edited a previous report ID. Must Unlock it.\r\n LockErr = 0\r\n LockId = ReportIDLast\r\n If LockSwt Then GoSub UnlockRecord\r\n If LockErr Then\r\n *Bad Bongos!\r\n Ans = msg('', 'CAN NOT UNLOCK PREVIOUS ID ':ReportIDLast:'.|WILL IGNORE IT!' )\r\n return 0\r\n End\r\n End\r\n *SO, the last report ID is done so the current ReportID will also be the last reportID\r\n .report_id_last->text = ReportID\r\n *Now, send the focus to the table name field.\r\n Void = send_event( @window:'.TABLE_NAME', 'LOSTFOCUS' )\r\n end else\r\n ReportRecord = ''\r\n *Report Record for the ID could not be read or was empty. Reset...\r\n GoSub ReturnAns\r\n end\r\nend else\r\n .report_id->Text = ''\r\n Message = 'You do not have the proper security to enter...' \r\n Message<micon$> = 'H'\r\n Void = msg( '', Message )\r\n Void = send_event( @window, 'CLOSE' )\r\nend\r\n\r\nRETURN 0\r\n\r\n*===========================================\r\nLockRecord:\r\n*===========================================\r\nLockErr = 1\r\nLock ConfigTable, LockID Then LockErr = 0\r\nReturn\r\n\r\n*===========================================\r\nUnlockRecord:\r\n*===========================================\r\nLockErr = 1\r\nunlock ConfigTable, LockID Then LockErr = 0\r\nReturn\r\n\r\n*===========================================\r\nLoadRecord:\r\n*===========================================\r\n*Report Record for the ID has been read and can now be loaded into the screen.\r\n.Table_Name->text = ReportRecord<TableName$>\r\n.Width->text = ReportRecord<Width$>\r\n.Title->text = ReportRecord<Title$>\r\n.Title_2->Text = ReportRecord<Title2$>\r\n.Title_3->Text = ReportRecord<Title3$>\r\n.Title_4->Text = ReportRecord<Title4$>\t\t \r\n.Title_Font_Type->text = ReportRecord<TitleFontType$>\r\n.Title_Font_Size->text = ReportRecord<TitleFontSize$>\r\n.Title_Font_Bold->check = ReportRecord<TitleFontBold$>\r\n.Title_Font_Italic->check = ReportRecord<TitleFontItalic$>\r\n.Title_Font_Underline->check = ReportRecord<TitleFontUnderline$>\r\n.Col_Hed_Font_Type->text = ReportRecord<ColHeadFontType$>\r\n.Col_Hed_Font_Size->text = ReportRecord<ColHeadFontSize$>\r\n.Col_Hed_Font_Bold->check = ReportRecord<ColHeadFontBold$>\r\n.Col_Hed_Font_Italic->check = ReportRecord<ColHeadFontItalic$>\r\n.Col_Hed_Font_Underline->check = ReportRecord<ColHeadFontUnderline$>\r\n.Def_Col_Font_Type->text = ReportRecord<DefFontType$>\r\n.Def_Col_Font_Size->text = ReportRecord<DefFontSize$>\r\n.Def_Col_Font_Bold->check = ReportRecord<DefFontBold$>\r\n.Def_Col_Font_Italic->check = ReportRecord<DefFontItalic$>\r\n.Def_Col_Font_Underline->check = ReportRecord<DefFontUnderline$>\r\n\r\n.Def_Font_Type->Text = ReportRecord<DefFontType$>\r\n.Def_Font_Size->text = ReportRecord<DefFontSize$>\r\n.Def_Font_Bold->check = ReportRecord<DefFontBold$>\r\n.Def_Font_Italic->check = ReportRecord<DefFontItalic$>\r\n.Def_Font_Underline->check = ReportRecord<DefFontUnderline$>\r\n\r\n\r\n.OrderBy->text = ReportRecord<ByStmt$>\r\n.Landscape_Chk->Check = ReportRecord<Landscape$>\r\n.Grid_Chk->Check = ReportRecord<Grid$>\r\n.No_Page_Chk->Check = ReportRecord<NoPage$>\r\n.Dbl_Spc_Chk->Check = ReportRecord<DoubleSpace$>\r\n.Id_Supp_Chk->Check = ReportRecord<IdSupp$>\r\n.Det_Supp_Chk->Check = ReportRecord<DetailSupp$>\r\n.Col_Hdr_Supp->Check = ReportRecord<ColumnHeaderSupp$>\r\n.Hdr_Supp->Check = ReportRecord<HeaderSupp$>\r\n.Slist_Script->text = ReportRecord<SlistScript$>\r\n.With_Statement->text = ReportRecord<WithStmt$>\r\n.Footer->text = ReportRecord<Footer$>\r\n.PageNumber->Check = ReportRecord<PageNumber$>\r\n.Report_Procedure->text = ReportRecord<ReportProcedure$>\r\n\r\narrayinfo< 1> = ReportRecord<Field$>\r\narrayinfo< 2> = ReportRecord<Header$>\r\narrayinfo< 3> = ReportRecord<ColLength$>\r\narrayinfo< 4> = ReportRecord<DataFontType$>\r\narrayinfo< 5> = ReportRecord<DataFontSize$>\r\narrayinfo< 6> = ReportRecord<DataFontBold$>\r\narrayinfo< 7> = ReportRecord<DataFontItalic$>\r\narrayinfo< 8> = ReportRecord<DataFontUnderline$>\r\narrayinfo< 9> = ReportRecord<BreakOn$>\r\narrayinfo<10> = ReportRecord<BreakOnValue$>\r\narrayinfo<11> = ReportRecord<Total$>\r\narrayinfo<12> = ReportRecord<Limit$>\r\n.COLUMN_INFO->array = arrayinfo\r\n\r\nReturn\r\n\r\n*===========================================\r\nReturnAns:\r\n*===========================================\r\nTmpStructure = ''\r\nMsg001 = 'REPORT ID ':ReportID:' IS NOT FOUND IN TABLE CONFIG!|'\r\nMsg001 = 'DO YOU WANT TO CREATE IT?'\r\nTmpStructure<MTEXT$> = Msg001\r\nTmpStructure<MTYPE$> = 'BNYC'\r\nTmpStructure<MMODAL$> = 'A'\r\nTmpStructure<MICON$> = '!'\r\nTmpStructure<MCAPTION$> = ReportID:' NOT FOUND IN CONFIG'\r\nAns = msg('', TmpStructure )\r\nIf Ans = 0 Or Ans = Char(27) Then\r\n Ans = msg('', \"RECORD EDIT CANCELED!\" )\r\n LockErr = 0\r\n LockID = ReportID\r\n GoSub UnlockRecord\r\n If LockErr Then\r\n Ans = msg('', 'CAN NOT UNLOCK NEW ':ReportID:'!|WILL IGNORE.' )\r\n End \r\n .report_id->text = ReportIDLast\r\n Void = post_event( @window:'.REPORT_ID', 'GOTFOCUS' )\r\n \r\nEnd Else\r\n *OK, want to create new one. If got last ID, Unlock it.\r\n If ReportIDLast Then\r\n LockId = ReportIDLast\r\n GoSub UnlockRecord\r\n If LockErr Then\r\n *OK, got error when trying to unlocked the last one. \r\n Ans = msg('', 'CAN NOT UNLOCK LAST REPORT ID: ':ReportIDLast:'!' )\r\n End\r\n Msg001 = 'DO YOU WANT TO START WITH AN EMPTY FORM?'\r\n TmpStructure<MTEXT$> = Msg001\r\n TmpStructure<MTYPE$> = 'BNYC'\r\n TmpStructure<MMODAL$> = 'A'\r\n TmpStructure<MICON$> = '!'\r\n TmpStructure<MCAPTION$> = ReportID:'NEW CONFIG RECORD'\r\n Ans = msg('', TmpStructure )\r\n If Ans = 1 Then\r\n GoSub ClearRecord \r\n End\r\n End\r\nEnd\r\nReturn\r\n\r\n*=======================================\r\nClearRecord: \r\n*=======================================\r\n.Table_Name->text = ''\r\n.Width->text = ''\r\n.Title->text = ''\r\n.Title_2->Text = ''\r\n.Title_3->Text = ''\r\n.Title_4->Text = ''\t \r\n.Title_Font_Type->text = '' \r\n.Title_Font_Size->text = ''\r\n.Title_Font_Bold->check = ''\r\n.Title_Font_Italic->check = ''\r\n.Title_Font_Underline->check = ''\r\n.Col_Hed_Font_Type->text = ''\r\n.Col_Hed_Font_Size->text = ''\r\n.Col_Hed_Font_Bold->check = ''\r\n.Col_Hed_Font_Italic->check = ''\r\n.Col_Hed_Font_Underline->check = ''\r\n.Def_Col_Font_Type->text = ''\r\n.Def_Col_Font_Size->text = ''\r\n.Def_Col_Font_Bold->check = ''\r\n.Def_Col_Font_Italic->check = ''\r\n.Def_Col_Font_Underline->check = ''\r\n.OrderBy->text = ''\r\n.Landscape_Chk->Check = ''\r\n.Grid_Chk->Check = ''\r\n.No_Page_Chk->Check = ''\r\n.Dbl_Spc_Chk->Check = ''\r\n.Id_Supp_Chk->Check = ''\r\n.Det_Supp_Chk->Check = ''\r\n.Col_Hdr_Supp->Check = ''\r\n.Hdr_Supp->Check = ''\r\n.Slist_Script->text = ''\r\n.With_Statement->text = ''\r\n.Footer->text = ''\r\n.PageNumber->Check = ''\r\n.Report_Procedure->text = ''\r\n\r\narrayinfo< 1> = ''\r\narrayinfo< 2> = ''\r\narrayinfo< 3> = ''\r\narrayinfo< 4> = ''\r\narrayinfo< 5> = ''\r\narrayinfo< 6> = ''\r\narrayinfo< 7> = ''\r\narrayinfo< 8> = ''\r\narrayinfo< 9> = ''\r\narrayinfo<10> = ''\r\narrayinfo<11> = ''\r\narrayinfo<12> = ''\r\n.COLUMN_INFO->array = arrayinfo\r\n\r\nReturn\r\n"
|
|
}
|
|
}
|
|
} |