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:
- via UniBasic’s native $INSERT command.
- 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
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
concatenation examples operators symbol