Include and Quotation Mark

shyl

New Member
I wonder whether anyone can give me a short explanation of the mechanism of 4GL's dealing with quotation marks in the file inclusion. As I really got confused by it.

The example I use to express my confusion is that:

file a.i
message {1} view-as alert-box.


file b.p
{a.i "hello world":U}

And when I run my b.p, the error reported is that variable hello is not defined. And if I changed the file b.p into

{a.i '"hello world":U'}

it prints hello world:U

If the a.i is a legacy file which cannot be changed by me, does it mean that I have no way to send the untranslated string "hello world" with that .i?
 

Casper

ProgressTalk.com Moderator
Staff member
Hi shyl,

The double quotation mark is to mark begin/end of preprocessor definition (or in this case compile time argument). single quote is always used to mark begin/end of string value.
If there are no preprocessor or compile time arguments involved then you can use both double and single quotes to start/end a string value.

So in your specific case you should do:

Code:
{ a.i "'Hello World':U" }

to get what you want.

Casper
 

sphipp

Member
I find single quotes in include files confusing, so I always use doubled-double-quotes (quoted double quotes). You could also use a variable but that requires an extra line of programming to set.

Code:
def var this_message as char initial "hello world":U no-undo.
{a.i "this_message" }
this_message = "Hello world":U.
{a.i "this_message" }
{a.i " ""Hello World"":U " }

As long as you remember that Progress puts exactly what is inside the quotes in the code then include files are relatively easy. Miss a quote off and they are difficult to debug.
 
Top