Parameter Question

RD_Man

Member
Greetings,

I have a snippet of code I wish to better understand. "{&file}"

&file="jobhdr"
(ASSIGN {&file}.Date = TODAY). <-- Works Great
Message {&file}. <-- Does Not Display "jobhdr"

It is an input parameter but I don't understand what it's Datatype would be in the called procedure!

I pass it a value like &file="jobhdr", that works great but I also wanted to display the value in a message. Is there a way to get it back to a usable Char value?

Mike
 
{&file} is a parameter passed to an include file or run-time program.

What happens is that Progress substitutes what was passed into the program/include file and that is what is actualy compiled.

So, in your example, if you pass "jobhdr" to the include file as &file then Progress changes every example of {&file} in the include file to jobhdr.

Your code then becomes ASSIGN jobhdr.Date = TODAY which is fine and Message jobhdr which won't work because you can't use message with a table, only with fields/variables/literals.

These parameters do not have type as they are not actual parameters in the same way as an INPUT PARAMETER is. In fact, they don't have to be single workds, you can pass lines of code, phrases and all kinds of things into include files. It makes a very general/generic include file very, very powerful indeed.
 
Sphipp.

Not only did you answer my question, but you answered a couple I have not even thought of yet.

Plus I now have my message working.
Message 'File Passed: {&file}'.

:) Thank You and Have A Great Weekend!!!

Mike
 
Back
Top