How can I check if every table cell is not equal to a number?

Hello,

I have a table with one row and 25 columns. How would I go about checking if every cell is not equal to zero.

But it's constantly checking.

So my rule would be if table (all of the cells) is equal to zero

Then do what ever action I need to do!

Hope that makes sense
Thanks

Comments

  • ChakkuChakku Member Posts: 1,513
    edited February 2013
    @Elfizm

    Make an attribute called totaltable.

    Constrain attribute-

    Constrain attribute totaltable to [tablecellvalue_1+tablecellvalue_2+tablecellvalue_3...]

    (So basically this attribute, totaltable, is the sum of all the cells that you want to check)


    Rule-

    If attribute total table ≠ [your number], then...........





    Hope this makes sense (let me know if it doesen't; I'm happy to help!)
    Chakku :)
  • ElfizmElfizm Member Posts: 489
    @Chakku thanks, just looking at it it seems like a very easy way of doing it, although I wonder if having plus tablevalue 25 times will fit in expression.
  • ChakkuChakku Member Posts: 1,513
    @Chakku thanks, just looking at it it seems like a very easy way of doing it, although I wonder if having plus tablevalue 25 times will fit in expression.
    @Elfizm

    Haha!

    I have actually tried that, and it works fine! :)

    (Although it may play bad on a device, depending on the device. Do an AdHoc build to be sure)

    Chakku

  • ElfizmElfizm Member Posts: 489
    @chakku Just thinking now and pretty sure I know the anwser but @socks is good at this maths stuff So hoping he might help.

    Would it be possible to have it like if row 1 ,column 1,2,3........25. Is not equal to zero.

    Would there be rule that can check all at once like they did in maths where you start a starting and an end and the computer does the rest?
  • kinzuakinzua Member Posts: 554
    @Elfizm you could run a loop by elevating a variable value (equal to row number) every 0.05sec and check till you reach the end of table. That will do for you.
  • ElfizmElfizm Member Posts: 489
    @kinzua thanks for help, although i did try this at the start I actually need:

    I have a table with one row and 25 columns. So 25 cells in total. I need to know when every cell is not equal to zero.

    So I thought I could have a rule that run on an integer that has the column number.

    Then if column 1 is not equal to zero then change and check next column. Then if it gets to the 26 column (which there isn't, but the attribute will display 26) then do action I want. That way I shouldn't have any timers.

    Sort of talking to my self now but I think I found a solution? Thanks for planting the seed of the idea :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah searching tables is still tricky. Hope we get searchable tables.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    No need to search, or check each cell. Just multiply all 25 cells together. If there is a zero in even one of the cells the answer will be zero. If all cells contain a number other than zero, the answer will not be zero. Remember:
    0*(any number) = 0
Sign In or Register to comment.