Multicolumn Printing (Text Flow)?
J. Landman Gay
jacque at hyperactivesw.com
Mon Nov 15 23:25:29 EST 2004
On 11/15/04 3:06 PM, Frank D. Engel, Jr. wrote:
> I'm reasonably certain I'm going to have to jury-rig something to get
> this working, but just in case anyone is aware of some easy (or easier)
> solution, I thought it might be a good idea to ask...
>
> I need to generate a printout featuring a header, a footer, and two
> columns of body text in between. The body text is coming from a single
> body of text (in other words, on data entry, it is entered as one long
> data entry in a single field, but when printed I need to split it into
> two columns). This is paragraph-style data, so I can hardly just count
> lines and split in half or anything...
>
> My best guess is to create separate fields for the left and right
> columns and somehow figure out where to split the text so that I can fit
> the text neatly into the two columns. Does anyone know of an easy way
> to figure out where to split this?
There is an old HyperCard hack for this. It isn't elegant -- I suppose
there is a more mathematical way -- but it works. We were never above
attacking these problems by brute force. ;)
You might want to lock the screen while this executes:
on splitText
get the bottomright of fld 1
subtract 5 from item 1 of it
subtract 5 from item 2 of it
click at it
put the number of words in char 1 to (word 4 of the selectedchunk) \
of fld 1 into theLastWd
set the htmltext of fld 2 to the htmltext of word theLastWd + 1 \
to (the number of words in fld 1) of fld 1
delete word theLastWd + 1 to (the number of words in fld 1) of fld 1
end splitText
If you need more columns, just take what's in field 2 and repeat the
process, putting the results into fld 3, and so forth.
The fields can't have much extra white space at the bottom; set the
height to just barely more than the last line and set the margins to
almost nothing. Otherwise the click command won't select in the correct
place. Alternately, you can increase the 5 pixel adjustment to account
for extra white space at the bottom of the field.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list