Hello!
Is it possible to add the values of an array object? I would like to add all the values writed in a specific Y line even if some of them are 0.
For exemple : if, X1,Y1=3 X2,Y1=5 X3,Y1=0 X4,Y1=6 Get the total value wich is 3+5+0+6=14
Printable View
Hello!
Is it possible to add the values of an array object? I would like to add all the values writed in a specific Y line even if some of them are 0.
For exemple : if, X1,Y1=3 X2,Y1=5 X3,Y1=0 X4,Y1=6 Get the total value wich is 3+5+0+6=14
just loop through the array at the y position you want,
Eg.
when button presed -- start loop "addup"--(number of times= the X size of your array)
on loop "addup" --- add to counter --read value from array xy position (X= loop index"addup" Y= the Ypos you want added up)
If you have a 1 based array just make X =loop index"addup"+1
Great! Thanks very much stiggits :)
It works well! is there a way to just count the number of cell where value is >0 ? Ex X1,Y1=3 X2,Y1=5 X3,Y1=0 X4,Y1=6 Total=3
if you want the total number of cells that contain a zero in Y
onloop"addup" ........add 1 to counter
& if value loopindex,Y =0
if you want the X positions of the zeros, add a list,
onloop"addup" .......add line to list, Str$( loopindex)
& if value loopindex,Y =0
Thanks very much! these informations are very valuable. How do you exactly input -- if value loopindex,Y =0--- I do not manage to get it.
I got it : In the expression editor Get the value XY of the array then ----> ValueAtXY("Array",1,Loopindex("addup")+1))=0