$SubIns: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
(Automatically generated page update)
Line 15: Line 15:


==Syntax==
==Syntax==
<p class="syntax"><span class="term">%STRING</span> = <span class="literal">$SubIns</span>(<span class="term">string</span>, ins_string, insert_pos)
<p class="syntax"><span class="term">%STRING</span> = <span class="literal">$SubIns</span>(<span class="term">string</span>, <span class="term">ins_string</span>, insert_pos)
</p>
</p>
<p>
<p>

Revision as of 01:52, 16 April 2013

Insert string inside another string

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubIns function is the Insert (String function).

This function inserts a string inside another.

The $SubIns function accepts three arguments and returns a string result.

The first argument is an arbitrary string.

The second argument is another arbitrary string.

The third argument is an insertion position in the first argument string.

Syntax

%STRING = $SubIns(string, ins_string, insert_pos)

%STRING is a string made up of string and ins_string.

If no insertion position is provided, the insertion string is appended to the end of the first input string. If the insertion point is past the first input string, the first input string is left unmodified.

For example, this statement sets %JUNK to PAT STAMPER, TRADER HORSE:

%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE')

This statement sets %JUNK to PAT STAMPER, HORSE TRADER:

%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 12)

This statement sets %JUNK to PAT STAMPER, TRADER:

%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 92)

Products authorizing $SubIns