Question get passing parameter number along with data type

Kartikeya Sharma

New Member
Hi All,

Might be my question is silly. Could you please guide me for correct path.

I want to get parameter number and datatype for each RUN statement.

e.g.
/*a.p*/
dvc call1.
dvi call2.
dvdt call 3.

RUN abc(input call1, call2,
call3).
/*end of file*/

want to do some code to get parameter number along with datatype.

expected output - parameter count 3 and datatype ... 1. character 2. integer 3. date.

Thanks
Kartikeya
 

GregTomkins

Active Member
I think GET-SIGNATURE is only useful for 'RUN x IN y', not a bare 'RUN x'. If this has changed in a recent OE, I'd love to know about that, we have invested untold hours in working around the limitation of not being able to run GET-SIGNATURE directly! If the OP wants to know about the (three) techniques we worked out to do this, let me know and I'll post about it ;)
 

Cringer

ProgressTalk.com Moderator
Staff member
Parsing your code would be the only solution. Proparse (which uses prolint) will probably do what you want, but it's not the easiest.
 

GregTomkins

Active Member
If you want to go down the parsing road ... I'd consider parsing .R. We do this in one situation and it works well (not sure I'd use it for a fly-by-wire system though). If you look at it with a binary editor, it's not very scary at all. It has the benefit that .R code is more likely to be available (ie. production environments may not have .P code). The drawback is that it will probably break with different Progress releases.
 

GregTomkins

Active Member
I'm not sure what you mean by "check" or whether you're talking about the RUN statement or the DEF INPUT PARAM side of things. However, bottom line, AFAIK (I'm not up on recent releases as we don't use them):

- you can use GET-SIGNATURE to discover parameters of internal procedures
- FUNCTION calls and signatures (but not RUN statements) get verified at compile time

If you are trying to verify in advance that every RUN statement will work parameter-wise, well, that sounds impractical to me ... but, I don't know about ProParse, haven't used it, heard good things about it, I'd start with JoanJu web site and go from there. Whether this will work for you or not probably depends on whether you are talking about a one-time analysis vs part of a production application.
 

TomBascom

Curmudgeon
You might want to clarify WHY you want to get the number of parameters and their datatypes for RUN statements.

Knowing that could quite possibly lead someone to suggest a useful solution to the underlying problem.
 
Top