[Stackoverflow] [Progress OpenEdge ABL] Processing unnamed optional include file parameters in Progress

Status
Not open for further replies.
W

W0lfw00ds

Guest
I'm trying to add a simple IF statement to my include .i-file to handle optional unnamed parameters:

message.i:

Code:
/*
    - {1}: Message.
    - {2}: OPTIONAL Sender name
*/
&IF DEFINED({2}) <> 0 &THEN
    {2} = "Unknown sender".
&ENDIF.
MESSAGE "{2}" + ": " + "{1}" VIEW-AS ALERT-BOX.

test.p:

Code:
{message.i "hello world" }
// Should output "Unknown sender: hello world".
// Does not compile.

{message.i "hello world" "Michael" }
// Should output "Michael: hello world".

In this version, the message.i will throw error if the second parameter is missing.

I want to use unnamed parameters and avoid the parameter naming.

How I can fix the code to make it work?

Continue reading...
 
Status
Not open for further replies.
Top