Xref: utzoo comp.sys.mac.hypercard:1271 comp.sys.mac:23031 Path: utzoo!utgpu!watmath!clyde!wayback!atux01!jlc From: jlc@atux01.UUCP (J. Collymore) Newsgroups: comp.sys.mac.hypercard,comp.sys.mac Subject: Query and Request of HyperCard Experts & Bill Atkinson Keywords: Bill (& Apple HC Development group) are you out there? Message-ID: <799@atux01.UUCP> Date: 16 Nov 88 15:48:44 GMT Organization: AT&T CSEd/CET, Piscataway, N.J. Lines: 77 Please forgive this cross-posting, however, I hope that I will be able to maximize my potential for getting a response to this query this way. THE QUERY: I need to know is there ANY way to, in essence, "pipe" (as UNIX does) one command to another (i.e., use the output of one operation as the input to another)? For example, (for those of you not familiar with UNIX), say that you wanted to look at a list of words (that was NOT in alphabetical order) that someone had input, HOWEVER, you wanted to SEE the list in alphabetical order, BUT you didn't want to change the person's file from the way it was. Well, you could do the following: cat wordfile | sort Note: "cat" is a UNIX command that prints out your the entire, specified file all at once. "wordfile" is just the imaginary name of our imaginary file of words. "|" is what is called a "pipe" in UNIX, which takes the output of the command on its left, and uses it as input to the command on its right. And finally, the UNIX "sort" command which will (in this case) sort all the lines of words into alphabetical order. "sort" is what's known as a "filter," (i.e., a program/command that can take its input from standard input, perform some operation on that input, and write the results to standard output). The results of doing this would be that the output you'd see on your screen would be an alphabetically sorted list, but the actual file would be unchanged. If you had wanted a printout of this (momentarily) sorted list, you could have typed in: cat wordfile | sort | lp (where "lp" is the UNIX command for your local "line printer"). This would simply have taken the output of your (temporarily) sorted list, and "piped" its output to the local line printer (Note: "lp" is another filter-type command). So ALL THIS leads me to my REAL question: Are there filters and/or pipes in HyperCard (HC)? Specifically, I want to perform a sort on cards, and pass the sorted cards to the "print" command. My problem is, in part, that I have multiple backgrounds in ONE stack. For example, I may have 5 cards of one background (call it "blue"). The problem is that after a sort is done, the 5 "blue" cards are no longer in CONTIGUOUS order. When I see my print, I see "blue," "blue," "red," "green," blue." Five cards are printed, but I've discovered that a "sort" command in HC will place the sorted cards back in the stack in a NON-CONTIGUOUS order! And since the current version of the HC "print" command DOES NOT allow you to print by a specified background name, I can't seem to have sort AND print (particularly "print with dialog") together in this format. I can do a sorts in my stack, OR a print (for a group of CONTIGUOUS cards) in my current stack set-up BUT NOT BOTH! This is a problem for me, because for my current application, if I use a multiple stack set-up (which I did earlier) I will use up ~102% more disk space!! Does anyone know a way of scripting that will allow my print command to find and print all the cards of ONE background, even if those cards are not in contiguous order (so that I can perform sorts of a given background, and still be able to print the sorted, NON-CONTIGUOUS cards later)? If you do, please send me e-mail, or post your reply to the comp.sys.mac.hypercard newsgroup. Thanks. THE REQUEST: To Bill Atkinson, or anyone connected with Apple's HyperCard Development group: In the next release of HyperCard, could you please: 1) create a "pipe-like" function, 2) could you make the "print" command and the "sort" command act as filters, 3) could you make the "print cards or open printing" commands understand background names as acceptable arguments? If any of you at Apple know a way that I can still accomplish my above task with features currently available in version 1.2 of HyperCard, please send me, or post, the solution or script. I would GREATLY appreciate it. Thank you for your help. Jim Collymore