Post Reply 
Short circuit logic
04-18-2020, 11:39 AM (This post was last modified: 04-18-2020 11:54 AM by Carlos295pz.)
Post: #4
RE: Short circuit logic
(04-18-2020 08:17 AM)mchris Wrote:  IF a>b THEN
do_something;
do_something_else;
END;

can be replaced by:

(a>b) AND (do_something; do_something_else);

In logical operation format it would be like this::

(a>b) AND (do_something) OR (do_something_else);

Knowing that do_something and do_something_else must return a real or integer otherwise an error occurs in execution. do_something must return a value other than 0

Example:
Code:
EXPORT LogicExpr(Boolean)
BEGIN
Boolean AND MSGBOX("True") OR MSGBOX("False") 
END;

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Short circuit logic - mchris - 04-18-2020, 08:17 AM
RE: Short circuit logic - DrD - 04-18-2020, 11:06 AM
RE: Short circuit logic - CyberAngel - 04-18-2020, 07:52 PM
RE: Short circuit logic - Carlos295pz - 04-18-2020, 11:35 AM
RE: Short circuit logic - Carlos295pz - 04-18-2020 11:39 AM



User(s) browsing this thread: 1 Guest(s)