Combine cards in a stack possible?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Combine cards in a stack possible?

Post by jalz » Sun Apr 20, 2014 12:37 am

Hi all,

Just wondering whether the following question is possible. I have three cards in a stack
1) header
2) body
3) footer

The header contains a logo and some general text, whilst the footer contains company address, registration number etc.
Both the header and footer contain information i would like to store once but call up if necessary for a report. The body will change depending on the type of report.

Is there a way i can pull these layouts together to make a single printable report.

Thanks jalz

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Combine cards in a stack possible?

Post by dunbarx » Sun Apr 20, 2014 5:22 am

Jalz.

The content of any control on any card, and the controls themselves, are always accessible. Check out the following examples:

put field "yourField" of cd "header" into field "headerInfo" of cd "report" -- some text on the header card
copy image "yourImage" of cd "header" to cd "report" -- the logo
put field "address" of cd "footer" into field "addressInfo" of cd "report" -- some text on the footer card

The card "report" is where you might collect all this data and stuff.

The important lesson here is to know that both information and actual objects on any card in any stack can be moved or copied to any card of any other stack. It is simply a matter of identifying the sources and destinations. Experiment with this and you will soon see how easy it is. Read up on the "copy" command in the dictionary. Understand that the "put" command has all that power built into it.

Once you have collected all your data and other stuff, you can print in any number of ways. I would start by laying out the "report" card itself in the way you want it, and simply printing that card.

Craig Newman

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Combine cards in a stack possible?

Post by Simon » Sun Apr 20, 2014 5:30 am

...and simply printing that card
For testing yes, in the end you may want to use an invisible card so as not to frighten the user (card will be larger than the stack, I believe).

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Combine cards in a stack possible?

Post by FourthWorld » Sun Apr 20, 2014 8:13 am

You may want to explore the IDE'S revPrintField command, as it builds print output from three separate stacks pretty much as you described.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply