|
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Non-printable text in secondary template
| Author |
Message |
|
kldavis
|
 Non-printable text in secondary template
I am working on a form template that has little room for coding. I created a second template that I call Calculations that is rather complex and contains the majority of the coding. This template is run at the beginning of the assembly of the Form template by use of the IncludeTemplate command. I then use the GetV command to place the values from the Calculations template into the actual form. The Calculations template, which contains only coding information, is already six pages and growing.
To better organize the template for debugging and other purposes, I would like to add comments or headings in the template that will not affect the outcome of the assembly of the form itself.
If I add text in the Calculations template, will this text somehow produce a Word document, or would the text be ignored (which is desired)?
Thanks.
|
| Wed Apr 07, 2010 2:58 pm |
|
 |
|
petertuffin
Joined: Tue Sep 29, 2009 4:27 am Posts: 64
|
 Re: Non-printable text in secondary template
The short answer to the question is "No" - this is because the IncludeTemplate command includes the body of the included template exactly as if it were coded inside the original template.
However, there's an informal way of adding comments into merge fields. If the merge field contains a command or function (e.g. <<ChooseFromList(Thing,This,That,The Other)>>) then you can type whatever you want after the closing parenthesis and it will be ignored.
In your example of a calculation, this would probably work quite nicely: <<SetV('DiscountedAmount',Amount * (1 - (Discount div 100))) this calculates the value of Amount less a discount of "Discount" %>>
This is used in places in the XpressDox Samples, and making the "comment" a different color helps the eye.
You can include "soft line breaks" inside a merge field, and these are also ignored in the merged document, so that above SetV could be made to look like:
<<SetV('DiscountedAmount',Amount * (1 - (Discount div 100)))
this calculates the value of Amount less a discount of "Discount" % >>
Just one caveat, though, and that is that if you put a question mark into the "comment", then the text to the right of the ? becomes help text (although in the case of the SetV this makes no difference).
Unfortunately, this technique does not extend to merge fields which contain a data element only. For example <<Amount this is the amount of the transaction>> is exactly the same as <<Amount>> <<this>> <<is>> <<the>> <<amount>> <<of>> <<the>> <<transaction>> - not what you want!
Maybe we need a <<Comment(this text is all ignored)>> command? What do you think?
_________________ Peter Tuffin
|
| Wed Apr 07, 2010 3:38 pm |
|
 |
|
Josie
|
 Re: Non-printable text in secondary template
Hi Peter
Just adding my 2 cents here. That was next on my question list to post here e.g. do you have a Comment(ignore all of this) statement?
If I can vote on that, my vote is YES PLEASE!!
|
| Fri Apr 23, 2010 1:52 pm |
|
 |
|
petertuffin
Joined: Tue Sep 29, 2009 4:27 am Posts: 64
|
 Re: Non-printable text in secondary template
So noted :)
_________________ Peter Tuffin
Last bumped by Anonymous on Thu May 06, 2010 7:52 am.
|
| Thu May 06, 2010 7:52 am |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You can post attachments in this forum
|
|