Posts: 4
Threads: 2
Joined: Sep 2007
Can I copy several numbers at once and send them to different variables.
Then calculate new amounts.
100.00
75.00
50.00
Then be able to do some math.
100/50=2
75/50=1.5
Then take that times a new amount like 55.00
55*2=110.00
55*1.5=82.5
Posts: 12,140
Threads: 142
Joined: Dec 2002
str sclip sline
double d ;;numeric variable that can contain .
ARRAY(double) a ;;array of variables for results
sclip.getclip ;;or use getsel
foreach sline sclip
,d=val(sline 2) ;;convert string to double
,a[a.redim(-1)]=d/50*55 ;;calculate and add to the array
;show results
int i
for i 0 a.len
,out a[i]
Posts: 4
Threads: 2
Joined: Sep 2007
Looks good but I would also like to have it go back and paste where there is an amount in the array.
date | 11/21/06 | 11/21/07
---------------------------------------------------------
| |
LIST | 100.00 | 110.00 < paste this amount from calculation
COL1 | 75.00 | 82.50 < paste this amount from calculation
COL2 | | < sometimes there will be an amount here.
COL3 | | < sometimes there will be an amount here.
PUB-COST | 50.00 | 55.0 < This would be the new amount I would key.
REP-COST | 50.00 | 55.0
The new amount that I key will be the amount to multiply up from.
and paste new values under the 11/21/07 column
How can I manually enter the 55.00 or whatever the new cost is into the calculation.
Then send the output back to the clipboard to paste.
I really love quick macros, but I have a ways to go to get the full use out of it.
Thanks,
yoz
Posts: 12,140
Threads: 142
Joined: Dec 2002
Use outp. It can paste strings and numeric values.
outp a[0]
outp a[1]
...