[comp.sys.mac.hypercard] Help tracking calculations in a field

a544@mindlink.UUCP (Rick McCormack) (01/12/91)

In an article, J B Nash of Uni of Wisconsin at Madison writes:
>The Tracking field tracks the price from month to month by
>showing the price over the last 12 months in a 12 line
>non-scrolling field.  When I push the Calculate button, a
>new price appears in the Price field (based on some script
>that I have no problem with) and the most recent price from
>that field goes to line one of the Tracking field, the next
>most recent price that was in line one goes to line two,
>line two price moves to three, three to four, etc.
>        Right now, when I say:
>
>  put line 1 of cd fld "Price" into line one of cd fld
>"Tracking"
>  put line 1 of cd fld "Tracking" into line 2 of cd fld
>"Tracking"
>  put line 2 of cd fld "Tracking" into line 3 of cd fld
>"Tracking"
>  put line 3 of cd fld "Tracking" into line 4 of cd fld
>"Tracking" etc..
>        I get the same price in every line of the field
>"Tracking"  I now understand why, but don't know how to
>remedy the situation.  Any suggestions? Basically, when the
>new price is calculated, I want to view in the Tracking
>field how the price has fluctuated over the last twelve
>times I've pushed the Calculation button.

 Seeing the problem is knowing the solution, or something
like that. When you have entered the new price into "cd fld
price" , instead of moving it to line 1 of cd fld
"tracking", move line 11 of cd fld "tracking" to line 12 of
cd fld "tracking", and line 10 to 11 etc. This will leave a
hole in line 1 of cd fld "tracking", into which you can move
line 1 of cd fld "price".
Luck.

______________________________________________________________
| Rick McCormack |  IMAGISTICS BUSINESS THEATRE TECHNOLOGY    |
| Vancouver,  BC |  Information transfer - with a purpose.    |
|     CANADA     |  ________________________________________  |
|  AOL:  Rique   |  INTERACTIVE  COMPREHENSIVE  ENLIGHTENING  |
|________________|____________________________________________|

jbnash@vms.macc.wisc.edu (John B. Nash) (01/13/91)

contains a number (a price of an item).  The Tracking field tracks the price 
from month to month by showing the price over the last 12 months in a 12 line 
non-scrolling field.  When I push the Calculate button, a new price appears in 
the Price field (based on some script that I have no problem with) and the most 
recent price from that field goes to line one of the Tracking field, the next 
most recent price that was in line one goes to line two, line two price moves to 
three, three to four, etc.
	Right now, when I say:

  put line 1 of cd fld "Price" into line one of cd fld "Tracking"
  put line 1 of cd fld "Tracking" into line 2 of cd fld "Tracking"
  put line 2 of cd fld "Tracking" into line 3 of cd fld "Tracking"
  put line 3 of cd fld "Tracking" into line 4 of cd fld "Tracking"
etc.. 
	I get the same price in every line of the field "Tracking"  I now 
understand why, but don't know how to remedy the situation.  Any suggestions?
Basically, when the new price is calculated, I want to view in the Tracking 
field how the price has fluctuated over the last twelve times I've pushed the 
Calculation button.
	Thanks! 
_______________________________________________________________________________
| 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 |
-------------------------------------------------------------------------------

ralph@world.std.com (Ralph Lombreglia) (01/14/91)

From article 2954:
>instead of moving it to line 1 of cd fld
>"tracking", move line 11 of cd fld "tracking" to line 12...

A much simpler answer is:

  put cd fld "Price" & return before cd fld "Tracking"

and let that ole gray mare HyperCard pull everything else right along.

Ralph Lombreglia
Internet: ralph@world.std.com   MCI Mail: rlombreglia   Bix: rlombreglia