Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!zazen!news From: jbnash@vms.macc.wisc.edu (John B. Nash) Newsgroups: comp.sys.mac.hypercard Subject: Help putting sum of field in another Message-ID: <1991Jan8.005708.5908@macc.wisc.edu> Date: 8 Jan 91 00:53:09 GMT Sender: news@macc.wisc.edu (USENET News System) Distribution: na Organization: University of Wisconsin Academic Computing Center Lines: 42 Hypertext question...simple problem I think, not insulting I hope. ----------------------------- | | for Version 1.2.2 | xxxxx VALUE field | These two cards have the same background | | Suppose I want to click on the CUMULATIVE field | xxxxx CUMUL. field | and have the sum of both VALUE fields appear | | in the CUMULATIVE field. ----------------------------- Is the script below on the right track? (background id 2763 for both cards). ----------------------------- | | | xxxxx VALUE field | | | | xxxxx CUMUL. field | | | ----------------------------- on mouseUp put zero into field "CUMULATIVE" put zero into total repeat with i = 1 to the number of cards in bg id 2763 add bg field "VALUE" to total put total into field "CUMULUATIVE" end repeat end mouseUp Right now, when I click on CUMULATIVE, it takes whatever number is in the VALUE field of the current card and multiplies it by the number of cards in the stack. Obviously this script is good if the numbers in the VALUE fields are all the same, but they are different from card to card. Ideas appreciated. Just E me _______________________________________________________________________________ | J. B. NASH Internet > jbnash@vms.macc.wisc.edu | | University of Bitnet > jbnash@wiscmac2 | | Wisconsin DECnet > wircs2::jbnash | | Madison from CompuServe > internet:jbnash@vms.macc.wisc.edu | -------------------------------------------------------------------------------