| 1 | /*:VRX         Main | 
|---|
| 2 | */ | 
|---|
| 3 | Main: | 
|---|
| 4 | signal on halt | 
|---|
| 5 | ok = VRRedirectSTdIO('OFF') | 
|---|
| 6 | parse arg LogFilename | 
|---|
| 7 |  | 
|---|
| 8 | ExceptFilename = filespec('D',LogFileName)||filespec('P',LogFileName)||'Except.$$$' | 
|---|
| 9 |  | 
|---|
| 10 | ok = SysFileDelete(Exceptfilename) | 
|---|
| 11 | I = 0 | 
|---|
| 12 | do while pos('Exception Information',LogLine) = 0 & lines(LogFileName) <> 0 | 
|---|
| 13 | LogLine = linein(LogFileName) | 
|---|
| 14 | idx = I // 10 + 1 | 
|---|
| 15 | Buffer.idx = LogLine | 
|---|
| 16 | I = I + 1 | 
|---|
| 17 | end | 
|---|
| 18 | if lines(LogFileName) = 0 then do | 
|---|
| 19 | call lineout ExceptFileName, 'No exception found in logfile!' | 
|---|
| 20 | end | 
|---|
| 21 | else do /* we had an exception lets create the dump */ | 
|---|
| 22 | do J = idx+1 to 10 | 
|---|
| 23 | call lineout ExceptFileName, Buffer.J | 
|---|
| 24 | end | 
|---|
| 25 | do J = 1 to idx | 
|---|
| 26 | call lineout ExceptFileName, Buffer.J | 
|---|
| 27 | end | 
|---|
| 28 | LogLine = linein(LogFileName) | 
|---|
| 29 | do until pos('End Of Exception Information',LogLine) > 0 | lines(LogFileName) = 0 | 
|---|
| 30 | LogLine = linein(LogFileName) | 
|---|
| 31 | call lineout ExceptFileName, LogLine | 
|---|
| 32 | end | 
|---|
| 33 |  | 
|---|
| 34 | do while pos('** BEGIN STACK DUMP **',LogLine) = 0 & lines(LogFileName) <> 0 | 
|---|
| 35 | LogLine = linein(LogFileName) | 
|---|
| 36 | I = I + 1 | 
|---|
| 37 | end | 
|---|
| 38 | call lineout ExceptFileName, LogLine | 
|---|
| 39 | do until pos('** END OF STACK DUMP **',LogLine) > 0 | lines(LogFileName) = 0 | 
|---|
| 40 | LogLine = linein(LogFileName) | 
|---|
| 41 | call lineout ExceptFileName,LogLine | 
|---|
| 42 | end | 
|---|
| 43 | end | 
|---|
| 44 | call lineout(ExceptFileName) | 
|---|
| 45 | call lineout(LogFileName) | 
|---|
| 46 | call halt | 
|---|
| 47 | exit | 
|---|
| 48 |  | 
|---|
| 49 | /*:VRX         Halt | 
|---|
| 50 | */ | 
|---|
| 51 | Halt: | 
|---|
| 52 |  | 
|---|
| 53 | exit | 
|---|
| 54 |  | 
|---|