Print Thread
How to escape template result
#61540 04/30/20 06:44 AM
Joined: Mar 2012
Posts: 38
Switzerland
Member
OP Offline
Member
Joined: Mar 2012
Posts: 38
Switzerland
Create a template "test.tpl" with this content :
Code
test := '&<name="Object">';

Execute this template in an SQL window and, in the "Object", enter the text : "Hello[X]"

This will consider [X] as a new input control and remove it.
How to tell the system, to consider result as is, without asking for new input ? (escape ?)

Thanks for your help

Re: How to escape template result
Philippe Malera #61542 04/30/20 09:17 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
You can specify && to escape substitution variables in your template. The && expression will be inserted as &.


Marco Kalter
Allround Automations
Re: How to escape template result
Marco Kalter #61546 05/01/20 08:33 AM
Joined: Mar 2012
Posts: 38
Switzerland
Member
OP Offline
Member
Joined: Mar 2012
Posts: 38
Switzerland
I've tried to modify my template as you said :
Code
test := '&&<name="Object">';
But now it doesn't substitute anything.
Could you give me a syntax example ? I didn't found anything in the doc.

Last edited by Philippe Malera; 05/01/20 08:50 AM.
Re: How to escape template result
Philippe Malera #61548 05/01/20 08:56 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Sorry, I misread your question. The only option here is to escape the brackets by supplying double brackets:

Hello[[X]]

We'll look into this though. I don't think the variable values that you enter should be reinterpreted as variables.


Marco Kalter
Allround Automations
Re: How to escape template result
Marco Kalter #61552 05/01/20 09:37 AM
Joined: Mar 2012
Posts: 38
Switzerland
Member
OP Offline
Member
Joined: Mar 2012
Posts: 38
Switzerland
Thanks, but in fact it is very difficult to explain to all developers to do such operation (duplicate brackets in the response).
As we are using suffix "[O]" for many of our applicative objects which have to be input in these template.
Hope we will get a fix.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.027s Queries: 14 (0.009s) Memory: 2.5166 MB (Peak: 3.0420 MB) Data Comp: Off Server Time: 2024-05-20 06:42:51 UTC
Valid HTML 5 and Valid CSS