Yogesh Chauhan's Blog

Two ways we can use colon(:) in Envision Basic

in Envision Basic on December 21, 2021

1. Used as a Concatenation Operator

The syntax is:


expr1 : expr2

The : operator concatenates two expressions. It is same as the CAT operator.

This how you can use : operator and CAT. Both will save “Hey there” in the Str variable.


Str = "Hey " CAT "there"
Str = "Hey " : "there"

2. Used as an Expand-in-Place Directive

The syntax is:


:directoryname filename [USING parameter(s)]:

The “:” directive is used to specify an EXPAND-IN-PLACE insert.

In Envision Basic, there are two ways to insert one block of code into another:

  1. via UniBasic’s native $INSERT command.
  2. via an EXPAND-IN-PLACE insert.

For example, the file “I_GETNBR” in the directory “UT.INSERTS” contains a block of Envision Basic code. You could reference that code within other code either as:


$INSERT I_GETNBR FROM UT.INSERTS

or


:UT.INSERTS I_GETNBR:

The $INSERT statement generally adds just a single line $INSERT statement to the generated source file which helps shrink the process’s generated source file size. That’s why the $INSERT technique is generally preferred.

If you use the colon syntax, it will insert the entire block of code into the generated source code.

The one exception to the rule of “a $INSERT statement adds just one line to a process’s generated source code” occurs when your process is a form and the insert block contains Envision extensions. In that case, the $INSERT statement behaves like an EXPAND-IN-PLACE insert.

Note: Envision extensions are statements that are not native to UniBasic, but are Ellucian-created extensions of UniBasic.

For historical reasons, the $INSERT statement does not exhibit that same exception when used in a batch process. That means $INSERTs used in a batch process are not permitted to contain Envision extensions.

If your insert file does not contain any Envision Basic extensions, then you should always use the $INSERT technique.

However, for historical reasons you may often see such insert files being used as EXPAND-IN-PLACE files.

At one time, UniBasic did not permit nested $INSERT statements. This is no longer the case.

Nested $INSERT statements means having a $INSERT statement in a file that was itself referenced by a $INSERT statement.

So one reason to use EXPAND-IN-PLACE inserts is to reference insert files that contain Envision extensions.

Another reason to use EXPAND-IN-PLACE inserts is that, via the USING keyword, they permit the use of placeholders.

Placeholders allow you to create an insert file with “to be filled in at run-time” pieces. These are defined in the insert file by the $USING line.

Credit: Envision Basic Command Reference


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
Add animation to your skills bar using CSSCSSWhat Is a Graph Database?MiscellaneousHow to update database configurations in WordPress?WordPressHow to Draw a Circle in HTML5 Using Canvas Tag?HTMLKeyValuePipe in Angular 9AngularHow to create a Bootstrap style accordion using CSS and JavaScript?CSS