The scripts used in the print field stack were designed to be
reusable..and in fact are used in the MetaCard script editor. To use you
can just copy the print field stack into your project, or if you feel
like it copy the scripts in stack "print field" into your stack. You can
use the print field stack like so:

start using stack "Print Field"
printfield [header],[text to print],[footer],[sourcefieldid]
stop using stack "Print Field"

Any expression surrounded by <% is evaluated by MetaCard. 

For example if I wanted to print the text of field 1, 
a) with a header displaying the document name on the topleft of the page
and the time on the topright of the page, I would type:
put "My Document"&tab&tab&"<%the time%>" into theader -- tabs determine
alignment in header and footer [left]<tab>[center]<tab>[right]

b)  and a footer displaying the date in the center and the pagenumber on
the topright of the page I would type:
put tab&"<%the date%>"&tab&"<%pagenumber%>" into tfooter

c) and of course, print the text of my field..but preserve all the text
styles.
put the htmltext of field "myfield" into ttext -- use htmltext to
preserve all the styles when printing

now to put it all together...

start using stack "Print Field"
printfield theader,ttext,tfooter

sourcefieldid is optional and is useful when you wish to print a field
using the textstyle, textsize of a field (useful is the text in a field
does not contain multiple styles).

For example if I wished to print my field(using the textsize/style of the
field)..with a simple footer (at the center of the page) displaying the
pagenumber I would type

start using stack "print field"
printfield "",field "myfield",tab&"<%pagenumber%">,the long id of field
"myfield"
stop using stack "print field"

To change the margins check out the printmargins property.

Hope this takes all the mystery out of the print field stack! 

PS. Those keeping up with the latest 2.4 features, will probably note
that PFSetText (which parses <%expression%> in text) can be replaced with
the new merge command.

Tuviah

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to