How to use square brackets in a template?

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

How to use square brackets in a template?

Postby mliskin » Tue Jun 07, 2011 1:29 am

is it possible to use square brackets in a template now that they are used as the delimiters for data fields?

For example, we need to have the text

[PRIVATE]

in a document, where PRIVATE is not a data field -- it's just text.

In some cases, we need to have a data field inside square brackets, like this:

[Job Number: [Job_Number]]

In that example, Job_Number is a data field, but the outer brackets are just text.

Is this possible? I'm getting errors from Dycodoc about missing field definitions.
mliskin
 
Posts: 5
Joined: Sat Jun 04, 2011 7:23 am

Re: How to use square brackets in a template?

Postby IDEAL Software Support » Wed Jun 08, 2011 3:50 pm

Use the "!" character as a so called "field-neutralizer".

For example: ![PRIVATE]

Note that the neutralizer is only required, if there are one or more closing square brackets "]" after an opening square bracket "[". If you use only opening square bracket(s), do not use the neutralizer.

Example: "[Hello" does not require a neutralizer. But "[Hello [field]" must be written as "![Hello [field]", even if there is no second closing square bracket.

But the present code does not allow nesting like "![Job Number: [Job_Number]]". We already fixed this here after reading your message. Please contact our support by e-mail, and we will send you an updated version of dycodoc v2.20. Please note that we can not fix this in older versions of dycodoc.

The fix also supports things like:
![Hello ![World [field]" where "[Hello" and "[World" are just text and "field" is a field.

or: ![Hello] ![World] [field]" where "[Hello]" and "[World]" are just text and "field" is a field.
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 68 guests