Boolean expressions with strings and numbers

I have two variables in my pre block, and I need a third (logical) one that identifies whether certain properties of these two are stored:

 str = "some string from a datasource"; qty = 15; //Also from a datasource 

The third valid variable must be true if str not empty and qty greater than 0. How to do this?

+4
source share
1 answer

ABOUT! I just realized:

 valid = not (str eq "") && (qty > 0); 

I had some syntax errors in the rest of my rule set; that trouble arose there.

+4
source

Source: https://habr.com/ru/post/1332440/


All Articles