Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!blkcat!f421.n109.z1.fidonet.org!Ken.Knight From: Ken.Knight@f421.n109.z1.fidonet.org (Ken Knight) Newsgroups: comp.sys.mac.hypercard Subject: Re: Combining Stacks Message-ID: <3026.278C494C@blkcat.fidonet.org> Date: 10 Jan 91 00:22:16 GMT Sender: ufgate@blkcat.fidonet.org (newsout1.26) Organization: FidoNet node 1:109/421 - The Twilight Clone, Paul Heller Lines: 103 david@bourbon.ee.tulane.edu (David Kaufmann) asks: >One list, for instance, is everybody; #2 is a short list for most >frequently contacted, a third the women's auxiliary, etc. > >1) What's the easiest way to combine the lists, putting on some tag so >that I can extract names as needed from group 1, 2, 3 or whatever, for >labels? > >2) Is hypercard the best program to use (I don't have any others and >this is a non-profit group I work for)? You have a few options (I'm assuming from your message that lists 1,2, and 3 are DIFFERENT stacks): 1. Write an overseer stack that will access the appropriate list as asked for by the user. The appropriate lists are maintained in their own stacks. The overseer would pull the information out of these lists and display it for you to work with. You would modify those lists by via the overseer stack. So, for example, to pull all the names out of list 2 you might do something like: on mouseUp lock screen set lockmessages to true push card go stack "list 2" repeat with i = 1 to the number of cards put fld "name" & return after tempStorage -- a container go next card end repeat pop card set lockmessages to false unlock screen put tempStore into card field "so-and-so" --place all the names now. end mouseUp To modify your lists using this approach you'd do something similar except in the repeat loop you would have a lines like: repeat with i 1 = to number of card put line i of tempStorage into field "name" go next card end repeat This method could get combersome very quickly. 2. Your other option is to write a script that will merge the stacks into an archive. This wouldn't be to tough if the individual lists are failry similar you just walk through the lists grabbing data and then plopping it into your new stack. You'd also set some sort of tab field that notes where each record came from. Let's say you have 2 different stacks that contain the same basic info, but are used for 2 different things (i.e. your list 1 and 2 HyperCard can do this sort of work quite effectively. Personally, I would go with option 2 - combine the stacks into a new stack that includes a tag field noting what list each record goes with. Then use that new stack exclusively (addding/deleting/modifying data). on mouseUp lock screen set lockmessages to true push card --save the current card of the merge stack go stack "list 1" repeat with i = 1 to number of cards --Gather in the data now. put fld "name" & return after nameStorage put fld "address" & return after addressStorage put fld "doodah" & return after doodahStorage go next card end repeat --Now do the gathering on "list 2" go stack "list 2" put the number of lines of nameStorage into list2StartsHere repeat with i = 1 to number of cards --Gather in the data now. put fld "name" & return after nameStorage put fld "address" & return after addressStorage put fld "doodah" & return after doodahStorage go next card end repeat pop card repeat with i = 1 to the number of lines of nameStorage put line i of nameStorage into fld "name" put line i of addressStorage into fld "address" put line i of doodahStorage into fld "doodah" if i <= list2StartsHere then put "list 1" into fld "tag" else put "list 2" into fld "tag" doMenu "New Card" end repeat unlock screen set lockmessages to false end repeat That is a crude example of how I might merge 2 stacks with the same structure into a third stack (already made). A better solution would probably ask the user for the stacks to merge together for example. In this case the "doodahStorage" can be whatever you want. I'm using LIST2STARTSHERE to mark what entries came from list 2 and then setting (Continued in Next Message) -- Ken Knight, Ken.Knight@f421.n109.z1.fidonet.org via The Black Cat's Shack's FidoNet<->Usenet Gateway blkcat.fidonet.org and Fidonet 1:109/401