User Tag List

Results 1 to 7 of 7

Thread: Add values of an array object

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Sep 2007
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add values of an array object

    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

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Feb 2015
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Sep 2007
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great! Thanks very much stiggits

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Sep 2007
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)

    Join Date
    Feb 2015
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Sep 2007
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Sep 2007
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it : In the expression editor Get the value XY of the array then ----> ValueAtXY("Array",1,Loopindex("addup")+1))=0

Similar Threads

  1. Replies: 1
    Last Post: 3rd March 2017, 01:32 PM
  2. Summation of values in an array
    By ierofei in forum Fusion 2.5
    Replies: 6
    Last Post: 1st December 2015, 07:59 PM
  3. Array vs Global Values
    By comrade_yak in forum Fusion 2.5
    Replies: 0
    Last Post: 9th April 2014, 09:41 PM
  4. Add values to Array without setting X and Y
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th March 2012, 11:58 PM
  5. Array vs. Counter vs. Object values
    By alxmrg in forum Hardware Accelerated Runtime
    Replies: 7
    Last Post: 19th May 2010, 10:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •