How to select only when the table is not empty

Hi!

I’ve really been trying to find a way to use select (from a table) only when the source table is not empty. Only way I’ve managed this far is with a dat execute (if source[0,0] != None, write to an another table or something similar) but I’d like to do this without scripting… Can anyone tell me a way to success? I’ve tried with eval and everything, but cannot figure it out…

Toni.

you can use an info chop and logic chop to create some boolean logic off of the number of rows or columns in a dat.

but if you are trying to access a specific cell by row or name, relying on != None is probably your best bet, as you can pack that into a 1 line expression, for example:

op('someDat')['someRow',1].val if op('someDat')['someRow',1] != None else op('someOtherDat')[0,0].val

that if used in an eval dat, or a select dat, you can try to reference a cell, but if it fails, fall back to some other value, or dat.

Okay, thanks! I’ll try to figure how to use the logic port version in my case!

This seems to be brilliant!

oh no, after all it wasn’t… :slight_smile: I mixed up something again, better go to sleep.

I’ll often do conditional checks in dat executes to make sure the table isn’t empty… something like