Aparajita,

I'll send you an example of what is happening when I'm back in the office
this week.

This heredoc is used as the template for an email message. It contained
wording similar to the following. The ...s are for example purpose and
text not shown for brevity.

$heredoc := """
Beginning of text... {0} ... {1} ... {2} ...

You are receiving this message because you are in the Organization's
\"Name of Group\".

Instructions:
{3}

Lot more text with 10 more parameters

..."""

With the ' in place {0}, {1}, and {2} would be substituted but {3} on
would show literally.

When I originally was debugging this I paired down the template to only
have the first 4 params. By escaping the ' where Organization's is used I
was able to get {3} to substitute. As I restored the template to its full
text something broke again and the problem re-appeared. If I don't escape
the ' I still have problems but the ' doesn't appear in the output.

I had to move on and reworded the template so that the ' wasn't required.

-- Brad


On 9/16/12 12:29 PM, "Aparajita Fishman" <[email protected]>
wrote:

>A single quote (single or double) doesn't have to be escaped within a
>heredoc string.
>
>On Sep 15, 2012, at 4:08 PM, "Perkins, Bradley D" <[email protected]>
>wrote:
>
>> I'd have to change some of the wording to present it here.
>> 
>> All problems were self-inflicted and largely the fault of my trying to
>> process the entire template with all 14 parameters up front. I'd never
>> done anything this complex with %% before and had never used a heredoc
>>for
>> as the format string.
>> 
>> By starting small with fewer parameters then iteratively working up to
>>the
>> full product I was able to identify where I was introducing errors.
>> 
>> However, my fix of escaping \' didn't work with the full template. I
>> worked around it by rewording the template so that the ' was not
>>required.
>> 
>> Brad
>> 
>> On 9/14/12 2:18 AM, "Aparajita Fishman" <[email protected]>
>> wrote:
>> 
>>> It wouldn't hurt if we saw the actual heredoc string. Otherwise we're
>>> just guessing.
>>> 
>>> On Sep 14, 2012, at 1:49 AM, "Perkins, Bradley D" <[email protected]>
>>> wrote:
>>> 
>>>> I have an email message template that I've created with a heredoc
>>>> string.
>>>> The template has 14 parameters {0} - {13}.
>>>> I'm finding that only the first 3 {0}-{2} are substituted and {3}-{13}
>>>> display literally.
>>>> 
>>>> The text of {3} does contain parens "(" and ")". I've tried to escape
>>>> them but that doesn't solve the problem.
>>>> I've replaced a
>>>> 
>>>> I can see via the console that the %% operator parameters contain
>>>>their
>>>> expected values.
>>>> 
>>>> Can I use a heredoc string as the format string with the %% operator?
>>>> Can I use multiple instances of the same parameter? I have a variable
>>>> "type" code that appears 4 times in the message. It substitutes the
>>>>last
>>>> parameter {13}.
>>>> The heredoc is declared as """ Š """ and does contain a few
>>>> double-quotes but I have \" escaped them.
>>>> Is there a limit on how many parameters can be passed to the %%
>>>> operator?
>>>> 
>>>> I've been trying to figure this out via trial for a few hours but am
>>>> stumped.
>>>> 
>>>> Thanks,
>>>> Brad Perkins
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Active4D-dev mailing list
>>>> [email protected]
>>>> http://list.aparajitaworld.com/listinfo/active4d-dev
>>>> Archives: http://active4d-nabble.aparajitaworld.com/
>>> 
>>> Regards,
>>> 
>>>  Aparajita
>>> 
>>> _______________________________________________
>>> Active4D-dev mailing list
>>> [email protected]
>>> http://list.aparajitaworld.com/listinfo/active4d-dev
>>> Archives: http://active4d-nabble.aparajitaworld.com/
>> 
>> _______________________________________________
>> Active4D-dev mailing list
>> [email protected]
>> http://list.aparajitaworld.com/listinfo/active4d-dev
>> Archives: http://active4d-nabble.aparajitaworld.com/
>
>Regards,
>
>   Aparajita
>
>_______________________________________________
>Active4D-dev mailing list
>[email protected]
>http://list.aparajitaworld.com/listinfo/active4d-dev
>Archives: http://active4d-nabble.aparajitaworld.com/

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to