Compiler Error Display
Posted: Fri Aug 03, 2012 11:32 pm
Hi, Jussi,
I'm running in to an issue trying to display compiler errors. I'm writing a LUA script to handle the compile of a COBOL program on the AS400. The process is:
1) Submit a compile job to the AS400
2) Wait for it to complete
3) Download the compile listing via FTP
4) Analyze the listing to produce an error file
5) Open the error file in a compiler window to display the results of the compile.
This is all working, but there is a problem with the error display. When I set up a document COMPILE command to just TYPE the error file, everything works perfectly. However, when I use a script and just do a file_open_compiler(<error file>,"Compile",<source file name>), the error displays stop working properly. In this case, it will show the wrong error text at times, indicate that there are no more errors when there are, and some other erratic results. It also works correctly for chunks of the file, then gets off track.
I'm using the error display macros that I wrote, mapped to keys to step forward and backward, which could be the source of the problem. However, it appears to me that the problem is that error_message() is behaving differently when the error file is TYPEd vs. file_open_compiler.
To narrow this down, I wrote a macro that strips out all the other steps and just displays the error file. When I do this, displaying the current error shows an incorrect first error, and error_message() returns a line of --------------- (dashes). When TYPEd as a result of a configured compile command, things work as expected.
I can send you copies of the files, macros, etc. if that will help.
It appears that running the compile command does some setup stuff that allows error_message() to work correctly, where the file_open_compiler executed from a LUA script does not. I am NOT running any kind of compile command in this non-working scenario - just running macros.
Bill Diener
I'm running in to an issue trying to display compiler errors. I'm writing a LUA script to handle the compile of a COBOL program on the AS400. The process is:
1) Submit a compile job to the AS400
2) Wait for it to complete
3) Download the compile listing via FTP
4) Analyze the listing to produce an error file
5) Open the error file in a compiler window to display the results of the compile.
This is all working, but there is a problem with the error display. When I set up a document COMPILE command to just TYPE the error file, everything works perfectly. However, when I use a script and just do a file_open_compiler(<error file>,"Compile",<source file name>), the error displays stop working properly. In this case, it will show the wrong error text at times, indicate that there are no more errors when there are, and some other erratic results. It also works correctly for chunks of the file, then gets off track.
I'm using the error display macros that I wrote, mapped to keys to step forward and backward, which could be the source of the problem. However, it appears to me that the problem is that error_message() is behaving differently when the error file is TYPEd vs. file_open_compiler.
To narrow this down, I wrote a macro that strips out all the other steps and just displays the error file. When I do this, displaying the current error shows an incorrect first error, and error_message() returns a line of --------------- (dashes). When TYPEd as a result of a configured compile command, things work as expected.
I can send you copies of the files, macros, etc. if that will help.
It appears that running the compile command does some setup stuff that allows error_message() to work correctly, where the file_open_compiler executed from a LUA script does not. I am NOT running any kind of compile command in this non-working scenario - just running macros.
Bill Diener