HyperCard 2.0: Sliding Objects in HyperCard Reports (7/92)

While HyperCard 2.0 doesn't have any native ability to slide report items up or left if one is blank while printing reports, it is possible to get that accomplished.

The trick is to use a single report item, instead of one for each field. Then, by double-clicking on the report item, you can set the contents of the item to a call to a function. The function can be in your stack or background scripts, and can process the information on the card.

For example:

Assume the following fields: Name, Company, Address1, Address2, City, State, and Zip. Now assume that Company and Address2 will sometimes be empty, and that they should slide.

For the contents of your one report item in your label template, simply enter the name of a function: makeLabel()

Now, in your stack script write something like the following handler:

function makeLabel
put bg field "Name" into theLabel
if bg field "Company" is not empty
then put return & bg field "Company" after theLabel
put return & bg field "Address1" after theLabel
if bg field "Address2" is not empty
then put return & bg field "Address2" after theLabel
put return & bg field "City" & ", "& bg field "State" & " " & bg field "Zip" after theLabel
return theLabel
end makeLabel

For each card that's printed in the report, the single report item will be evaluated according to the function above, and will print the formatted label.

This article is adapted from the Claris Tech Info database.

Support Information Services
Published Date: Feb 19, 2012