What is the preferred way to check if dictionary is empty?
Hello!
Currently I'm checking the number of the keys in the dictionary by using the [getkeys] message and then putting the output of the third [dict] outlet to the [zl len]. But there is absolutely no output if the dictionary is empty.
What is the preferred way to check if dictionary is empty?
Thank you!
Here is my attempt to read from dict only if it is not empty:
Max Patch
Copy patch and select New From Clipboard in Max.
Any better way?
I don't know about official way, this is a simpler try:
Max Patch
Copy patch and select New From Clipboard in Max.
OTOH, if you control the source of dicts, maybe you could tag them with eg. "hasData" key, and then check with dict.route.
Max Patch
Copy patch and select New From Clipboard in Max.