$SubIns: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Insert string inside another string<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Insert string inside another string<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubIns function is [[to be entered]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubIns function is the [[Insert (String function)]].</p>
 
 


This function inserts a string inside another.  
This function inserts a string inside another.  
Line 15: Line 13:


The third argument is an insertion position in the first argument string.
The third argument is an insertion position in the first argument string.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %STRING = $SubIns(string, ins_string, insert_pos)
<p class="syntax"><section begin="syntax" /> %STRING = $SubIns(string, ins_string, insert_pos)
Line 21: Line 20:
</p>
</p>
<p class="caption">%STRING is a string made up of '''string''' and '''ins_string'''.</p>
<p class="caption">%STRING is a string made up of '''string''' and '''ins_string'''.</p>


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.  
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 <tt>PAT STAMPER, TRADER HORSE</tt>:
For example, this statement sets %JUNK to <tt>PAT STAMPER, TRADER HORSE</tt>:
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE')
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE')
</p>
</p>


This statement sets %JUNK to <tt>PAT STAMPER, HORSE TRADER</tt>:


This statement sets %JUNK to <tt>PAT STAMPER, HORSE TRADER</tt>:
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 12)
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 12)
</p>
</p>


This statement sets %JUNK to <tt>PAT STAMPER, TRADER</tt>:


This statement sets %JUNK to <tt>PAT STAMPER, TRADER</tt>:
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 92)
<p class="code"> %JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 92)
</p>
</p>
Line 48: Line 47:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p class="caption">Products authorizing $SubIns
<p class="caption">Products authorizing $SubIns
</p>
</p>


[[Category:$Functions|$SubIns]]
[[Category:$Functions|$SubIns]]

Revision as of 20:26, 8 February 2011

<section begin="desc" />Insert string inside another string<section end="desc" />

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

<section begin="syntax" /> %STRING = $SubIns(string, ins_string, insert_pos) <section end="syntax" />

$SubIns Function

%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