$SubIns: Difference between revisions
Jump to navigation
Jump to search
(Automatically generated page update) |
(Automatically generated page update) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Insert string inside another string</span> | <span class="pageSubtitle">Insert string inside another string</span> | ||
<p class="warn"><b>Note: </b> | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubIns function is <var>[[Insert (String function)|Insert]]</var>.</p> | ||
This function inserts a string inside another. | This function inserts a string inside another. | ||
Line 37: | Line 37: | ||
<p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE') | <p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE') | ||
</p> | </p></li> | ||
<li>This statement sets %JUNK to <code>PAT STAMPER, HORSE TRADER</code>: | <li>This statement sets %JUNK to <code>PAT STAMPER, HORSE TRADER</code>: | ||
<p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 12) | <p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 12) | ||
</p> | </p></li> | ||
<li>This statement sets %JUNK to <code>PAT STAMPER, TRADER</code>: | <li>This statement sets %JUNK to <code>PAT STAMPER, TRADER</code>: | ||
<p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 92) | <p class="code">%JUNK = $SubIns('PAT STAMPER, TRADER', ' HORSE', 92) | ||
</p> | </p></li> | ||
</ol> | |||
==Products authorizing {{PAGENAMEE}}== | ==Products authorizing {{PAGENAMEE}}== | ||
Line 53: | Line 54: | ||
<li>[[List of $functions|Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[ | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[ | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li>Japanese functions</li> | <li>Japanese functions</li> | ||
<li>[ | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$SubIns]] | [[Category:$Functions|$SubIns]] |
Latest revision as of 23:29, 20 September 2018
Insert string inside another string
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SubIns function is Insert.
This function inserts a string inside another.
The $SubIns function accepts three arguments and returns a string result.
Syntax
%string = $SubIns(string, ins_string, insert_pos)
Syntax terms
%string | The string result that is a combination of string and ins_string. |
---|---|
string | An arbitrary string. |
ins_string | A string to be inserted in the string value. |
insert_pos | The insertion position in the string argument string. |
Usage notes
- 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.
Examples
- 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)