Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!labrea!swenson@aulait.Stanford.EDU From: swenson@aulait.Stanford.EDU (Norman Swenson) Newsgroups: comp.sys.mac.hypercard Subject: Re: How to copy a card without generating unique bkg? Keywords: CloseCard Message-ID: <5@aulait.stanford.edu> Date: 27 Jan 89 03:25:20 GMT References: <16@bernoulli.stanford.edu> <24456@apple.Apple.COM> <377@isl.stanford.edu> <8455@orstcs.CS.ORST.EDU> Reply-To: swenson@aulait.UUCP (Norman Swenson) Distribution: usa Organization: Stanford University Lines: 46 In article <377@isl.stanford.edu> I wrote: > >Fair enough! If you change the bkg, even one pixel, you get a new bkg id. >But I didn't change _ANYTHING_! In article <8455@orstcs.CS.ORST.EDU> johnsot@jacobs.CS.ORST.EDU.UUCP (Tim G. Johnson) responded: > > Ok, it is obvious that you haven't >changed anything, but the background may have been changed by a >CloseCard script when you went to the last card of the stack. Things >to look for are changing the hilite of a button or something >obscure like that....That would explain why it works sometimes and >sometimes it doesn't, if the script conditionally changes the hilite >of a button. > Excellent advice, Tim. _I_ didn't change _ANYTHING_. Unfortunately, the script I wrote _DID_. You were absolutely right, except that the offending script was an On OpenCard handler. Since this may bite somebody in the future, I'll elaborate. The following OpenCard handler (which is in the bkg script) sets the hilite of a background check box button to the contents of a hidden fld: set the hilite of bg button "read" to (fld "readfld" is true) A closecard handler stores the hilite of bg button "read" in fld "readfld". When I cut the card to move it, the hilite of "read" was always false. When I went to the last card, the last card received an OpenCard message. Hence if "readfld" in the last card contained true, the hilite of "read" was set to true for that bg. If this bg happended to be the bg of the card I cut, I (or I mean the script :-)) just changed it, resulting in a unique ID when I pasted. You can see why I would sometimes get a unique ID, and other times I wouldn't, depending on the bg of the last card and the contents of readfld on that card. Thanks to those providing advice. My apologies for cluttering the net with this. Hopefully it was instructive for others. I know it was for me. I guess experience (and a good dose of public humiliation) is still the best teacher. Now, why can't I get "find exp in fld fldname" to work with multiple bkgs? Norm swenson@isl.stanford.edu