Is there any tool or compile option to check whether argumen

Posted by mengchao.agile on 22-Mar-2014 23:13

Always get runtime error of "Mismatch parameter calling xxx.p".  I guess it is caused by "late binding" feature of progress so that the compiler cannot find this kind of issues at compile time.

Is there any tool or compile options to check this kind of error?  If no, is there any clue how to write one?

All Replies

Posted by Thomas Mercer-Hursh on 23-Mar-2014 10:03

Use OO! :)

Posted by mengchao.agile on 23-Mar-2014 10:18

But we have to maintain millions of lines of legacy code.  It is currently impossible to convert them to OO

Posted by Thomas Mercer-Hursh on 23-Mar-2014 10:30

Hence the smiley, but the point is that this is an advantage of OO that does not exist without it.  By the same token, you presumably know that most of your existing code works so you really only need to deal with new code.  So, consider introducing OO for your new code.  This might mean some refactoring, but if you are changing signatures anyway, then you have to do some refactoring anyway.

It is imaginable that one could add a signature checker to the tool I will be discussing at PUG Challenge Americas in June.  It won't be in the first release, but it seems possible.

Posted by Brian K. Maher on 24-Mar-2014 06:51

Use the -debugalert startup parameter and when you get the error click the help button.  That will give you the current call stack so you can find the bad code.

Posted by James Palmer on 24-Mar-2014 07:02

That's a good solution, but I think the OP is after a way of tracking it at compile time, not at run time.

Posted by Brian K. Maher on 24-Mar-2014 07:11

As far as I am aware there isn't any option to detect it at compile time.
 
 

Posted by Evan Bleicher on 24-Mar-2014 10:14

Brian is correct.  The ABL Compiler can not provide this functionality, since the RUN statement is very dynamic in nature.  For example, the name of the procedure invoked is evaluated at runtime.  Additionally, if the invoked procedure is contained in another persistent procedure, that information is not evaluated till runtime.  Given these limitations, the compiler cannot provide the level of validation you are looking for.  As Thomas noted, this is one of the advantages of Object Oriented programming.

This thread is closed