开发者

Boolean expressions with strings and numbers

开发者 https://www.devze.com 2023-01-30 20:16 出处:网络
I have two variables in my pre block, and I need a third (a boolean) that identifies whether certain properties hold of t开发者_高级运维hose two:

I have two variables in my pre block, and I need a third (a boolean) that identifies whether certain properties hold of t开发者_高级运维hose two:

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

The third variable, valid, needs to be true when str is not empty and qty is greater than 0. How do I do that?


Oh! I just figured it out:

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

I had some syntax errors in the rest of my ruleset; that's where the trouble was coming from.

0

精彩评论

暂无评论...
验证码 换一张
取 消