Passing blank numbered parameters to an include file

D.Cook

Member
Is it possible?

For example I have an include file with two parameters. The first parameter I wish to leave blank, but I want to pass a value for the second parameter.

The best idea I had was an empty pair of double-quotes. But it becomes one set of double-quotes.

Code:
{include.i "" param2}
include.i contents:
Code:
&message |{1}|{2}|
results:
|"|param2|
 

D.Cook

Member
Thanks for the responses.

Single quotes are (strangely) not counted as quotes, so the result is:
Code:
|'|'|
And a space between double-quotes is in most cases good enough, but unfortunately I need zero spaces in this case.
Code:
| |param2|
This is the result I'm looking for, but I think I'm going to have to find a workaround.
Code:
||param2|
 

Casper

ProgressTalk.com Moderator
Staff member
I don;t know if this is what you are looking for, but this gives the desired result:

Code:
MESSAGE '|' + {1} + '|' + {2}.

Casper.
 

D.Cook

Member
Actually the first parameter is used as part of a variable name in the include file, like this:
Code:
def var var{1}name.
So I need the first parameter value to be empty, resulting in "def var varname.", not "def var var name." which will cause an error.

Obviously it wasn't the best design in the first place, but I'm not keen on changing include files when they are referenced by many programs..
 

taqvia

Member
Try out this playing around with special characters:

/*t1.i*/

DEF VAR VAR{1}NAME AS CHAR.
DEF VAR VAR{2}NAME AS CHAR.

MESSAGE "DEF VAR VAR{1}NAME AS CHAR".
MESSAGE "DEF VAR VAR{2}NAME AS CHAR".



/*t1.p*/

{c:\t1.i ~ ~~ "taqvi"}

/*note there is a space between first tilde and the next two consecutive tilde*/

Regards,
Arshad
 

D.Cook

Member
It seems I never got the email notification for these responses back in 2009, what a shame.

{c:\t1.i ~ ~~ "taqvi"}
This works, amazingly!

{include.i &1= param2}
This doesn't work, results in "|param2||". It's a shame, because it would be really nice syntax to use. Playing around with &<number>= gives interesting (weird) results.. but none of which seem useful.
 
Top