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 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

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
How to zoom an element on hover using CSS?CSSHow to create a Progress Bar using JavaScript?JavaScriptHow to reference an aliased column in the WHERE clause?SQL/MySQLHow to undo Git Commits on Pantheon?MiscellaneousHow to create Glowing Texts using CSS?CSSHow to CREATE TABLE in SQL with and without using Another Table?SQL/MySQL