[comp.sys.mac.hypercard] Merging stacks

ben@ut-emx.UUCP (Benjamin Sloan) (02/19/89)

Does anybody know of an easy way to merge two stacks?  Given identical
stacks, each with a collection of cards with identical backgrounds, how
would one combine these into one big stack?  Of course, one could cut or copy
cards one at a time from one stack to the other, or write a script to do it,
but shouldn't there be an easier way?

Thanks in advance for your help.

Ben Sloan
ben@emx.utexas.edu

johnv@sequent.UUCP (John VanZandt) (06/05/90)

I have two 'address' stacks which I'd like to merge.  Does anyone have
a script which will merge the stacks without creating two backgrounds?

John Van Zandt			
Sequent Computer Systems
uunet!sequent!johnv

gannholm@apple.com (Martin Gannholm) (06/06/90)

In article <36192@sequent.UUCP> johnv@sequent.UUCP (John VanZandt) writes:
> I have two 'address' stacks which I'd like to merge.  Does anyone have
> a script which will merge the stacks without creating two backgrounds?


I wrote an XCMD a few years back that will merge *any* bkgnds together, 
regardless of how different they appear or how many fields are on either. 
I am posting the stack with the XCMD to comp.binaries.mac.

Martin Gannholm
Apple Computer

I have nothing to disclaim...

willcox@urbana.mcd.mot.com (David A Willcox) (06/07/90)

>> I have two 'address' stacks which I'd like to merge.  Does anyone have
>> a script which will merge the stacks without creating two backgrounds?

I was under the impression, from something I read some time ago, that
doing a "Copy Card" in one stack and "Paste Card" multiple times would
result in the second stack having a bunch of separate backgrounds,
each with one card.  However, I tried it last nite and found out
otherwise.  I copied all cards in one background between stacks
essentially as follows (this from memory):

    on cpbg tgtStack,theBg
	set lockMessages to true
	set lockScreen to true
	push card
	go first card of background theBg
	repeat with i = 1 to the number of cards in background theBg
	    domenu "Copy Card"
	    push card
	    go stack tgtStack
	    go last card of background theBg
	    domenu "Paste Card"
	    pop card
	    go next card of background theBg
	end repeat
	pop card
    end cpbg

When I looked at the background information for the background
in question in the target stack, it said that the background was
shared by a bunch of cards, so I deduce that multiple backgrounds were
not created.  This seems to work even with very old versions of
HyperCard.  Am I deceived?

David A. Willcox		"Just say 'NO' to universal drug testing"
Motorola MCD - Urbana		UUCP: ...!uiucuxc!udc!willcox
1101 E. University Ave.		INET: willcox@urbana.mcd.mot.com
Urbana, IL 61801		FONE: 217-384-8534

lev@amarna.gsfc.nasa.gov (Brian S. Lev) (06/08/90)

In article <1276@urbana.mcd.mot.com>, willcox@urbana.mcd.mot.com (David A Willcox) writes...
>>> I have two 'address' stacks which I'd like to merge.  Does anyone have
>>> a script which will merge the stacks without creating two backgrounds?
> 
>I was under the impression, from something I read some time ago, that
>doing a "Copy Card" in one stack and "Paste Card" multiple times would
>result in the second stack having a bunch of separate backgrounds,
>each with one card.  
				    o
				    o
				    o

In my (still somewhat limited) experience, each card you copy between stacks
carries a copy of its background; the final result is the sum of the different
backgrounds.  In (hopefully!) clearer terms:

START:	Stack A, bg a, cd A1-An (all cards have bg "a")
	Stack B, bg b, cd B1-Bn (all cards have bg "b")

PROCESS: Copy cards B1-B4 into Stack A

END:	Stack A, bg a&b, cd A1-An+4 (stack now contains 2 backgrounds)
	Stack B, bg b, cd B1-Bn (all cards have bg "b")


+----------------------------------------------------------------------------+
|  Brian Lev/STX                           (301)286-9514   (FTS)888-9514     |
|  NASA Goddard Space Flight Center        DECnet: SDCDCL::LEV  (6153::LEV)  |
|  Advanced Data Flow Technology Office    TCP/IP: lev@dftnic.gsfc.nasa.gov  |
|  Code 930.4                              BITNET: LEV@DFTBIT                |
|  Greenbelt, MD  20771                    TELENET: [BLEV/GSFCMAIL]          |
|     X.400 Address: (C:USA,ADMD:TELEMAIL,PRMD:GSFC,O:GSFCMAIL,UN:BLEV)      |
+----------------------------------------------------------------------------+
|   "The ability of a network to knit together the members of a sprawling    |
|   community has proved to be the most powerful way of fostering scienti-   |
|   fic advancement yet discovered."  -- Peter Denning                       |
+----------------------------------------------------------------------------+
|     DISCLAIMER: THESE STATEMENTS ARE MY OWN AND *NOT* NASA'S OR STX'S!     |
+----------------------------------------------------------------------------+

david@bourbon.ee.tulane.edu (David Kaufmann) (11/09/90)

I have three address stacks, imported to the MAC and transferred to HC
(the data was originally on an IBM--somebody else's). These stacks are
used almost exclusively for mailing labels (although phone no.s are on
1 or 2). Many of the names are duplicates in the stack. What I would
like to do is  1) combine the 3 stacks into one master and 2) have a
flag on that master so I can select which labels to print according to
the current categories. I suspect using more than one background may
do it, but I'm a bit lost. (This is not HC2.)

Thanks.

David Kaufmann
INTERNET:	david@bourbon.ee.tulane.edu