开发者

Boolean expressions with strings and numbers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜