Can we suppress the warning alone?

Hi Everybody,
When i compile my code i get few warning messages and error messages. I want to know is there a way to suppress the warning message alone and throw only error message to the screen, if any.

Thanks in advance.
 

lord_icon

Member
You get the messages when you, 'compile my code'. Asking is there any way to surpress the messages, yes there is. Learn how to program in the ABL/4GL !!
 

Casper

ProgressTalk.com Moderator
Staff member
Then you must use some other procedure then the application compiler. It is easy to write your own compile procedure.
This is a small example of a procedure which takes a file name and a save dir as input parameters, compiles the file and writes the report to a log file.
It is easy to change so that there will be messages with an error.

Code:
DEFINE INPUT PARAMETER cp_file   AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER cp_savdir AS CHARACTER NO-UNDO.
DEFINE VARIABLE c_msg     AS CHARACTER NO-UNDO.
DEFINE VARIABLE c_opties  AS CHARACTER NO-UNDO.
DEFINE VARIABLE c_outfile AS CHARACTER NO-UNDO.
DEFINE VARIABLE l_ishtml AS LOGICAL   NO-UNDO.
DEFINE VARIABLE i_tel     AS INTEGER   NO-UNDO.
DEFINE STREAM s_log.
OUTPUT STREAM s_log TO c:\temp\testcomp\complog.log APPEND.
IF SUBSTRING(ENTRY(NUM-ENTRIES(cp_file,'.'),cp_file,'.'),1,3) = 'htm'
THEN DO:
     ASSIGN l_ishtml = true.
     RUN webutil\e4gl-gen.r( INPUT cp_file,
                             INPUT-OUTPUT c_opties,
                             INPUT-OUTPUT c_outfile
                            ).
END.
COMPILE VALUE(IF l_ishtml THEN c_outfile ELSE cp_file) SAVE INTO VALUE(cp_savdir) NO-ERROR.
IF COMPILER:ERROR
THEN DO:
     ASSIGN c_msg = (IF l_ishtml THEN c_outfile ELSE cp_file) + ': Compile error: ' + COMPILER:FILE-NAME + CHR(10) +
                    'on line ' + STRING(COMPILER:ERROR-ROW) + CHR(10).
     DO i_tel = 1 TO ERROR-STATUS:NUM-MESSAGES:
         ASSIGN c_msg = c_msg + ERROR-STATUS:GET-MESSAGE(i_tel) + CHR(10).
     END.
END.
ELSE ASSIGN c_msg = ENTRY(NUM-ENTRIES(cp_file,'\'),cp_file,'\') + ' is succesfully compiled and saved in ' + cp_savdir + '|' + STRING(COMPILER:WARNING,'J/N').
PUT STREAM s_log UNFORMATTED c_msg + CHR(10).
IF l_ishtml THEN OS-DELETE VALUE(c_outfile).

This writes the output to a log file.

Casper.
 

rstanciu

Member
Hello "moderator" ... moderate your answers ... the guy is a newbye,
he can do any mistakes he wants to do,
... your job to "moderate" the discution thread and "fire" them if it is a reason to do.

(FR): je sais pas ce qu'on fume en Netherlands, mais, ca sent fort ... envoi moi ta recette
A+ rares
 

Casper

ProgressTalk.com Moderator
Staff member
Hello "moderator" ... moderate your answers ... the guy is a newbye,
he can do any mistakes he wants to do,
... your job to "moderate" the discution thread and "fire" them if it is a reason to do.

I responded to the very rude and useless answer lord_icon gave. A question was asked, the answer was learn 4GL. What has that to do with moderating my answers? You think lord_icon answered in a positive way? If so, then we strongly disagree....
edit:
Well maybe is this a language problem so I'll explain: The answer lord_icon gave was: learn 4GL. IMO an utterly useless and pointless answer. My respond to lord_icon was: Why do you think he asked the question? Meaning to say with that: He asked a question because he wants to learn. So I don't see any harm in my response.

Casper.
 

rstanciu

Member
This is clair ! ... our gui "saravanakumar," is a new man on 4GL.
For the momment is not "on top", this is clear.
Your role is ... , and my role is ... to to help him to be the best !
 

rstanciu

Member
This opinion is my opinion:
developer helped -> developper win -> sallary grow -> his bos win -> progress DLC win -> I can pay taxes :D
 
Hi Team,
My question was fairly clear and simple. I asked if there is a way to suppress the warnings alone using compile statement (I knew that we can suppress the errors by using NO-ERROR option).

I expect the answer should be either YES/NO. It would be great if i get an alternative idea for the same as well, that is what Casper gave me which is the exact way to respond. See, i am not a newbie to 4GL but still i am not a genius, i might have even missed out something which i can get from such forums.

Please understand that questions might be different or silly. The simple funda is i don't have answer to it so i am posting the query to a well recognized forum like this. The gentle way is, If you don't like to answer or if the question seems to be silly please don't respond. There are more experienced guys than you in this forum, so please don't be harsh to anyone at any point of time.

Thanks for all your responses.
 
Top