Yogesh Chauhan's Blog

AND, OR and NOT boolean operators in Envision Basic

in Envision Basic on January 3, 2022

The AND Boolean operator

The AND Boolean operator in Envision Basic, just like any other programming language, combines a set of expressions.

So, if both expressions are false, then the combined expression is false too.

In other words, both expressions needs to be true for the combined expressions to be true.

Syntax


expression1 AND expression2


expression1 & expression2

Example


X = 1 ; Y = 2 ; Z = 3
IF (X < Y) AND (Y < Z) THEN REPROMPT
END

The OR Boolean operator

The OR Boolean operator in Envision Basic, combines a set of expressions.

So, if both expressions are false, then and then the combined expression is false.

In other words, any one expression needs to be true in order for the combined expressions to be true.

Syntax


expression1 OR expression2


expression1 ! expression2

Example


X = 1 ; Y = 2 ; z = 3
IF (X < Y) OR (Y < Z) THEN GOSUB RETRY:

The NOT Boolean operator

The NOT Boolean operator in Envision Basic reverses the logical result of the argument expression.

If the expression is true, the function returns false (0).

If the expression is not true, the function returns true (1).

Syntax


NOT(expr)

Example

The condition won't be satisfied and THEN statement will be executed.


X = 1 ; Y = 2
IF NOT(X > Y) THEN GOSUB RETRY:


Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
WP_Query Class in WordPressWordPressWhat is IPS(Intrusion Prevention System), How Does It Work and What are the Detection Types?MiscellaneousHow to use @if and @else in SCSS?SCSSAdd animation to your skills bar using CSSCSSCreate a simple bar chart and column chart using pure CSS gridCSSHow to create a Child Theme in WordPress?WordPress