$DelCh: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$DelCh}} <span class="pageSubtitle"><section begin="desc" />Remove characters from string, compress and strip blanks<section end="desc" /></span> <p class="warnin...")
 
(Automatically generated page update)
 
(43 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$DelCh}}
{{DISPLAYTITLE:$DelCh}}
<span class="pageSubtitle"><section begin="desc" />Remove characters from string, compress and strip blanks<section end="desc" /></span>
<span class="pageSubtitle">Remove characters from string, compress and strip blanks</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $DelCh function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $DelCh function is the <var>[[Remove (String function)|Remove]]</var> function.</p>


This function removes specified characters from an input string and performs blank compression and stripping.  
This function removes specified characters from an input string and performs blank compression and stripping.  


The $DelCh function accepts four arguments and returns a string result that is part of the first argument string.  
The <var>$DelCh</var> function accepts four arguments and returns a string result that is part of the first argument string.  


The first argument is an arbitrary string.  
The first argument is an arbitrary string.  
Line 15: Line 15:


The fourth argument is a number indicating the type of blank compression or stripping to be performed. Valid numbers and their meanings are:
The fourth argument is a number indicating the type of blank compression or stripping to be performed. Valid numbers and their meanings are:
<ul>


<li>1 - delete the specified characters  
<ol>
<li>2 - delete the specified characters and strip leading and trailing blanks  
<li>delete the specified characters  
<li>3 - delete the specified characters, strip leading and trailing blanks and compress multiple blanks to a single blank.
<li>delete the specified characters and strip leading and trailing blanks  
</ul>
<li>delete the specified characters, strip leading and trailing blanks and compress multiple blanks to a single blank.
</ol>
 
This is an optional argument and defaults to 1.
This is an optional argument and defaults to 1.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %STRING = $DelCh(string, chars, start_pos, option)
<p class="syntax"><span class="term">%STRING</span> = <span class="literal">$DelCh</span>(<span class="term">string</span>, <span class="term">chars</span>, <span class="term">start_pos</span>, [<span class="term">option</span>])
<section end="syntax" /></p>
<p class="caption">$DelCh Function
</p>
</p>
<p class="caption">%STRING is part of the first argument string.</p>


<p>%STRING is part of the first argument string.</p>


For example, the following statement sets %JUNK to <tt>CD</tt>:
==Examples==
<p class="code"> %JUNK = $DelCh('ABCDAAAABAB', 'AB')
<ol>
<li>The following statement sets %JUNK to <tt>CD</tt>:
<p class="code">%JUNK = $DelCh('ABCDAAAABAB', 'AB')
</p>
</p>


 
<li>This statement sets %JUNK to <tt>W HAV WAITD LONG NOUGH</tt>:
 
<p class="code">%JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'E', , 3)
This statement sets %JUNK to <tt>W HAV WAITD LONG NOUGH</tt>:
<p class="code"> %JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'E', , 3)
</p>
</p>


 
<li>This statement sets %JUNK to <tt>WE HAV AITD ONG NOUGH</tt>:
 
<p class="code">%JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'WEL', 5, 3)
And this statement sets %JUNK to <tt>WE HAV AITD ONG NOUGH</tt>:
<p class="code"> %JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'WEL', 5, 3)
</p>
</p>
</ol>


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius Functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</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>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $DelCh
</p>


[[Category:$Functions|$DelCh]]
[[Category:$Functions|$DelCh]]

Latest revision as of 22:51, 20 September 2018

Remove characters from string, compress and strip blanks

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $DelCh function is the Remove function.

This function removes specified characters from an input string and performs blank compression and stripping.

The $DelCh function accepts four arguments and returns a string result that is part of the first argument string.

The first argument is an arbitrary string.

The second argument is the set of characters to be removed from the first argument string.

The third argument is a starting position in the first argument string.

The fourth argument is a number indicating the type of blank compression or stripping to be performed. Valid numbers and their meanings are:

  1. delete the specified characters
  2. delete the specified characters and strip leading and trailing blanks
  3. delete the specified characters, strip leading and trailing blanks and compress multiple blanks to a single blank.

This is an optional argument and defaults to 1.

Syntax

%STRING = $DelCh(string, chars, start_pos, [option])

%STRING is part of the first argument string.

Examples

  1. The following statement sets %JUNK to CD:

    %JUNK = $DelCh('ABCDAAAABAB', 'AB')

  2. This statement sets %JUNK to W HAV WAITD LONG NOUGH:

    %JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'E', , 3)

  3. This statement sets %JUNK to WE HAV AITD ONG NOUGH:

    %JUNK = $DelCh(' WE HAVE WAITED LONG ENOUGH ', 'WEL', 5, 3)

Products authorizing $DelCh