11 lines
5.5 KiB
JSON
11 lines
5.5 KiB
JSON
{
|
|
"header": {
|
|
"version": 1,
|
|
"type": "record"
|
|
},
|
|
"body": {
|
|
"record1": {
|
|
"<1>": "declare subroutine rlist, activate_save_select,SetInitDirOptions\r\ndeclare function msg, create_dialog, Set_Property,format\r\ndeclare function dialog_box,fieldcount, dirlist\r\n$insert rlist_equates\r\n$insert msg_equates\r\n$insert dict_equates\r\n/*\r\nCrLf = Char(13):Char(10)\r\nTb = Char(9)\r\nGoSub LoadErrorValues\r\n.reports_completed->text = ''\r\n\r\nReportPath = .dict_reports_path->text\r\nIf ReportPath[-1,1] # \"\\\" Then ReportPath := \"\\\"\r\nCheckName = ReportPath:\"File.Txt\"\r\nOsWrite \"OK\" To CheckName\r\nIf Status() Then\r\n GoSub ProcessError\r\n Return 0\r\nEnd\r\nCheckName = ''\r\nInitDir ReportPath:\"*.*\"\r\nLoop\r\n Files = DirList()\r\nWhile Files\r\n FldCnt = FieldCount(Files, @FM)\r\n .tot_table->Text = FldCnt\r\n For K = 1 To FldCnt\r\n OneBlkSwt = 0\r\n DictName = ReportPath:Files<K>\r\n Fle = Dir(DictName)\r\n If Fle<1> < 64000 Then\r\n OneBlkSwt = 1\r\n OsRead OsBlock From ReportPath:Files<K> Else\r\n Void = msg( '', 'Unable to read ':DictName)\r\n Return\r\n End \r\n End Else\r\n OSFileSpec = ReportPath:Files<K>\r\n OsOpen OSFileSpec To OSFile Else\r\n GoSub ProcessError\r\n Return 0\r\n End\r\n End \r\n BldMsg = ''\r\n FlaBrk = 80 \r\n FleCtr = 0\r\n GoSub SetPointers\r\n BugSwt = 0\r\n BckCtr = 0\r\n Byte = 0\r\n Loop\r\n FldCtr = 0\r\n BckCtr += 1\r\n If OneBlkSwt Then\r\n Swap CrLf With @FM in OsBlock\r\n Swap Tb With @VM in OsBlock\r\n \r\n End Else\r\n OSBRead OsBlock From OsFile At Byte Length 64000\r\n ChrCnt = FieldCount(OsBlock,CrLf)\r\n ChrPos001 = Index(OsBlock,CrLf,ChrCnt) - 1\r\n OsBlock = OsBlock[1,ChrPos001]\r\n Byte += ChrPos001\r\n Swap CrLf With @FM in OsBlock\r\n Swap Tb With @VM in OsBlock\r\n If BckCtr = 0 Then\r\n TblNme = 'DICT.':OsBlock<1,3>\r\n Open TblNme As DictName Else \r\n Void = msg( '', 'Unable to open ':DictName)\r\n Return\r\n End\r\n End\r\n End\r\n ChrPos001 = Index(OsBlock,@FM,1)\r\n OsBlock[1,ChrPos001] = '' \r\n .table_count->text = BckCtr\r\n \r\n\r\n\r\n\r\n Repeat\r\n BldMsg := CrLf\r\n MsgLen=Len(BldMsg)\r\n GoSub WriteIt\r\n End \r\n \r\nGET.NEXT.TABLE:\r\n \r\nRepeat\r\n\r\n.reports_completed->text = \"Dictionary Reports Are Completed\"\r\n\r\nReturn 0\r\n\r\n\r\n*==================================\r\n*GoSubs\r\n*==================================\r\nWriteIt:\r\n*==================================\r\nGoSub WriteNow\r\nOsClose WritFile\r\nReturn\r\n\r\n*==================================\r\nWriteNow:\r\n*==================================\r\nOsBWrite BldMsg To WritFile At WritByte\r\nWritByte += MsgLen \r\nBldMsg = ''\r\nReturn\r\n\r\n\r\n*==================================\r\nSetPointers: \r\n*==================================\r\nDataPointers = ''\r\nDataPointers< 1,1> = 1 ;DataPointers< 1,2> = 'Type'\r\nDataPointers< 2,1> = 2 ;DataPointers< 2,2> = 'FMC'\r\nDataPointers< 3,1> = 3 ;DataPointers< 3,2> = 'Column Heading'\r\nDataPointers< 4,1> = 4 ;DataPointers< 4,2> = 'S/M'\r\nDataPointers< 5,1> = 5 ;DataPointers< 5,2> = 'Key Part'\r\nDataPointers< 6,1> = 6 ;DataPointers< 6,2> = 'Btree'\r\nDataPointers< 7,1> = 7 ;DataPointers< 7,2> = 'Output'\r\nDataPointers< 8,1> = 8 ;DataPointers< 8,2> = 'Formula'\r\nDataPointers< 9,1> = 9 ;DataPointers< 9,2> = 'Just'\r\nDataPointers<10,1> = 11 ;DataPointers<10,2> = 'Length'\r\nDataPointers<11,1> = 14 ;DataPointers<11,2> = 'Description'\r\n\r\nReturn\r\n\r\n\r\n*==================================\r\nProcessError:\r\n*==================================\r\nErrNum = Status()\r\nMsgTtl := MsgErr<ErrNum>: FileName\r\nMsgStruc = \"\"\r\nMsgStruc<mtext$> = MsgTtl\r\nMsgStruc<mtype$> = \"BStop\"\r\nMsgStruc<micon$> = \"H\"\r\nMsgStruc<mcaption$> = \"FILE ERROR - ABORTING\"\r\n\r\nVoid = msg( '', MsgStruc)\r\n\r\n.reports_completed->text = MsgErr<ErrNum>\r\n\r\nReturn\r\n \r\n*==================================\r\nLoadErrorValues:\r\n*==================================\r\nMsgTtl = \"Can Not Delete OS FIle \":CrLf\r\nMsgErr = \"\"\r\nMsgErr<1> = \"Bad operating system filename: \"\r\nMsgErr<2> = \"Access denied by operating system: \"\r\nMsgErr<3> = \"Disk or directory full... \"\r\nMsgErr<4> = \"Operating system file does not exist: \"\r\nMsgErr<5> = \"Undefined error on operating system file: \"\r\n\r\nReturn\r\n\r\n\r\n*==================================\r\nBreakDown:\r\n*==================================\r\nIf Len(TmpChk<L>) > FlaBrk Then\r\n X=0\r\n Loop While Len(TmpChk<L+X>) > FlaBrk\r\n TmpVar<L+X> = TmpChk<L+X>[1,FlaBrk]\r\n Ysav = TmpChk<L+X>[1,FlaBrk]\r\n Ysav[1,FlaBrk] = ''\r\n TmpChk<L+X> = Ysav\r\n If Len(TmpChk<L+X>) Then TmpVar<L+X+1> = Str(Tb,K)\r\n X+=1\r\n Repeat\r\n TmpVar<X> = ''\r\nEnd \r\n\r\nReturn \r\n\r\n*==================================\r\nLoadInputFileNames:\r\n*==================================\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nReturn\r\n*/"
|
|
}
|
|
}
|
|
} |