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 How to check if radio button is checked or not using JavaScript? #2 How to add Read More Read Less Button using JavaScript? #3 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#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 #Jan 14 How to display a student’s individual transcript in Colleague? #Jan 11 How to install PuTTY on a MacOS?
You might also like these
Understanding the confusing and handy “This” keyword in JavaScriptJavaScriptThe ALPHA function in Envision BasicEnvision BasicCSS Overflow Property with ExamplesCSSUse SwiperJS to create mobile touch sliders fastMiscellaneousWhy do we need HAVING Clause in SQL?SQL/MySQLThe * arithmetic operator in Envision BasicEnvision Basic