PRINT code

G

Garry Rathbone

I have a document that has several IF tests. If the user
responds with a Y to a test, a document is included using
INCLUDETEXT.

We use PRINT codes to switch the printer into duplex mode
in certain documents. These documents work fine on their
own, and fine when included with INCLUDETEXT. However, if
the INCLUDETEXT is conditional via an IF, the PRINT codes
don't work!

For example:

Doc1.doc is a 5 page document that has a PRINT command at
the start to switch the printer (HP4000) into Duplex:
{PRINT 27"&l1s"}

Doc2.doc has the following field in it:

{IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"}

Any ideas? Any help appreciated.

Cheers,


Garry
 
P

Peter Jamieson

I haven't seen this problem before and don't know of a fix, but...

If it's the combination of INCLUDETEXT nested in an IF that's causing the
problem, what I would try is to ensure the INCLUDETEXT is outside the IF.
You will always have to include /a/ file. e.g. have an empty document called
empty.doc and try either

{ INCLUDETEXT "{ IF "{ FILLIN Include_DOC_1 }" = "Y" "DOC1.DOC"
"empty.doc" }" }

or

{ IF "{FILLIN Include_DOC_1}" = "Y"
"{ SET mydoc1 "DOC1.DOC" }"
"{ SET mydoc1 "empty.doc" }"
}{ INCLUDETEXT "{ REF mydoc1 }" }
 
G

Garry Rathbone

Peter,

Thanks for your suggestion, it works great. INCLUDETEXT
seems to add an extra return even when there's nothing in
the empty document, but we can live with that.

Thanks again,

Garry
 
M

macropod

Hi Garry,

I think you'll find that the problem with your original field was that there
was no space between the '=' and the "Y". That is, instead of:
{IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"}
you needed:
{IF {FILLIN Include_DOC_1}= "Y" "{INCLUDETEXT "DOC1.DOC"}"}
or:
{IF {FILLIN Include_DOC_1}= "Y" {INCLUDETEXT "DOC1.DOC"}}


Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top