$List Diff Item: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$List_Diff_Item}} <span class="pageSubtitle"><section begin="desc" />Differences between $list and delimited $list item<section end="desc" /></span> <p class="war...")
 
(Automatically generated page update)
 
(43 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$List_Diff_Item}}
{{DISPLAYTITLE:$List_Diff_Item}}
<span class="pageSubtitle"><section begin="desc" />Differences between $list and delimited $list item<section end="desc" /></span>
<span class="pageSubtitle">Differences between $list and delimited $list item</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $List_Diff_Item 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 $List_Diff_Item function is <var>[[ItemDifferenceList (Stringlist function)|ItemDifferenceList]]</var>.</p>


This function determines which items in a $list do not appear as an entry in a separator delimited item in a second $list and places them on a third $list. In some sense this is the "difference&CQ. between a $list and a separator delimited $list item.  
This function determines which items in a $list do not appear as an entry in a separator delimited item in a second $list and places them on a third $list. In some sense this is the "difference" between a $list and a separator delimited $list item.  


$List_Diff_Item accepts five arguments and returns a numeric result. It is a callable $function (:hdref refid=callfun.).  
<var>$List_Diff_Item</var> accepts five arguments and returns a numeric result. It is a [[Calling Sirius Mods $functions|callable]] $function.  


The first argument is the identifier of a $list for which each item is to be compared against the delimited item in the second $list. This is a required argument.  
The first argument is the identifier of a $list for which each item is to be compared against the delimited item in the second $list. This is a required argument.  
Line 12: Line 12:
The second argument is the identifier of a $list containing the item containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.  
The second argument is the identifier of a $list containing the item containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.  


The third argument is the identifier of a $list to contain any items from the first $list that do not appear as a delimiter separated entry in the indicated item from the second $list. The $list specified by the third argument is cleared before $List_Diff_Item does any processing. This is a required argument.  
The third argument is the identifier of a $list to contain any items from the first $list that do not appear as a delimiter separated entry in the indicated item from the second $list. The $list specified by the third argument is cleared before <var>$List_Diff_Item</var> does any processing. This is a required argument.  


The fourth argument is the number of the item from the second $list containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.  
The fourth argument is the number of the item from the second $list containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.  


The fifth argument is the delimiter character or characters to be used in the scanning the indicated $list item. It defaults to comma (<tt>,</tt>), and it cannot be the null string. Specifying this argument as a null string is the same as either not specifying the argument or specifying it as a comma.
The fifth argument is the delimiter character or characters to be used in the scanning the indicated $list item. It defaults to comma (<tt>,</tt>), and it cannot be the null string. Specifying this argument as a null string is the same as either not specifying the argument or specifying it as a comma.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> [%RESULT =] $List_Diff_Item(list_id1, list_id2, list_id3, -
 
list_item2, separator)
<p class="syntax">[%RESULT =] $List_Diff_Item(list_id1, list_id2,-
<section end="syntax" /></p>
                  list_id3, list_item2, separator)
<p class="caption">$List_Diff_Item Function
</p>
<p>
</p>
</p>
<p class="caption">%RESULT is set to the number of items added to the output $list, or it is set to a negative error code if an error has occurred.</p>
<p><var class="term">%result</var> is set to the number of items added to the output $list, or it is set to a negative error code if an error has occurred.</p>


For an example of the use of this function, suppose $list %LIST1 contains six items:


For an example of the use of this function, suppose $list %LIST1 contains six items:
<p class="code"> BBB
<p class="code"> BBB
  CC
  CC
Line 36: Line 37:
</p>
</p>


And $list %LIST2 contains two items:


And $list %LIST2 contains two items:
<p class="code"> X,Y,Z,
<p class="code"> X,Y,Z,
  AAA,DDDD,FFF,
  AAA,DDDD,FFF,
</p>
</p>


Then this statement:


Then this statement:
<p class="code"> %CNT = $LIST_DIFF(%LIST1, %LIST2, %LIST3, 2)
<p class="code"> %CNT = $LIST_DIFF(%LIST1, %LIST2, %LIST3, 2)
</p>
</p>


results in %LIST3 having three items:


results in %LIST3 having three items:
<p class="code"> BBB
<p class="code"> BBB
  CC
  CC
  E
  E
</p>
</p>
%CNT is set to <tt>3</tt>.  
%CNT is set to <tt>3</tt>.  


If a value occurs multiple times in the first input $list, it will appear either the same number of times in the output $list or not at all, depending on whether it appears in the separator- delimited item in the second $list.  
If a value occurs multiple times in the first input $list, it will appear either the same number of times in the output $list or not at all, depending on whether it appears in the separator- delimited item in the second $list.  


For example, if $list %LIST1 contains eight items:


For example, if $list %LIST1 contains eight items:
<p class="code"> TCP/IP
<p class="code"> TCP/IP
  SNA
  SNA
Line 72: Line 71:
</p>
</p>


And $list %LIST2 contains three items:


And $list %LIST2 contains three items:
<p class="code"> Y2K**SECURITY**PRODUCTIVITY**METRICS**
<p class="code"> Y2K**SECURITY**PRODUCTIVITY**METRICS**
  IND$FILE**LU6.2**SNA**MQSERIES**LU2**
  IND$FILE**LU6.2**SNA**MQSERIES**LU2**
  GIF**JPEG**WAV**PDF**HTML**
  GIF**JPEG**WAV**PDF**HTML**
</p>
</p>


Then this statement:
Then this statement:
Line 86: Line 82:
</p>
</p>


Results in $list %LIST3 having five items:


Results in $list %LIST3 having five items:
<p class="code"> TCP/IP
<p class="code"> TCP/IP
  CORBA
  CORBA
Line 96: Line 91:
</p>
</p>


%CNT is set to <tt>5</tt>.


%CNT is set to <tt>5</tt>.<p>
<p class="code">
  -3 - No room in CCATEMP
  -3 - No room in CCATEMP
  -5 - Required argument not specified
  -5 - Required argument not specified
Line 107: Line 103:
<p class="code">  
<p class="code">  


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[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>[[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>
</p>
<p class="caption">Products authorizing $List_Diff_Item
<p>
</p>
</p>




[[Category:$Functions|$List_Diff_Item]]
[[Category:$Functions|$List_Diff_Item]]

Latest revision as of 22:51, 20 September 2018

Differences between $list and delimited $list item

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

This function determines which items in a $list do not appear as an entry in a separator delimited item in a second $list and places them on a third $list. In some sense this is the "difference" between a $list and a separator delimited $list item.

$List_Diff_Item accepts five arguments and returns a numeric result. It is a callable $function.

The first argument is the identifier of a $list for which each item is to be compared against the delimited item in the second $list. This is a required argument.

The second argument is the identifier of a $list containing the item containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.

The third argument is the identifier of a $list to contain any items from the first $list that do not appear as a delimiter separated entry in the indicated item from the second $list. The $list specified by the third argument is cleared before $List_Diff_Item does any processing. This is a required argument.

The fourth argument is the number of the item from the second $list containing a delimiter separated string that is to be scanned for each item from the first $list. This is a required argument.

The fifth argument is the delimiter character or characters to be used in the scanning the indicated $list item. It defaults to comma (,), and it cannot be the null string. Specifying this argument as a null string is the same as either not specifying the argument or specifying it as a comma.

Syntax

[%RESULT =] $List_Diff_Item(list_id1, list_id2,- list_id3, list_item2, separator)

%result is set to the number of items added to the output $list, or it is set to a negative error code if an error has occurred.

For an example of the use of this function, suppose $list %LIST1 contains six items:

BBB CC DDDD AAA E FFF

And $list %LIST2 contains two items:

X,Y,Z, AAA,DDDD,FFF,

Then this statement:

%CNT = $LIST_DIFF(%LIST1, %LIST2, %LIST3, 2)

results in %LIST3 having three items:

BBB CC E

%CNT is set to 3.

If a value occurs multiple times in the first input $list, it will appear either the same number of times in the output $list or not at all, depending on whether it appears in the separator- delimited item in the second $list.

For example, if $list %LIST1 contains eight items:

TCP/IP SNA CORBA MQSERIES SNA TCP/IP IPX TCP/IP

And $list %LIST2 contains three items:

Y2K**SECURITY**PRODUCTIVITY**METRICS** IND$FILE**LU6.2**SNA**MQSERIES**LU2** GIF**JPEG**WAV**PDF**HTML**

Then this statement:

%CNT = $List_Diff_Item(%LIST1, %LIST2, %LIST3, , '**')

Results in $list %LIST3 having five items:

TCP/IP CORBA TCP/IP IPX TCP/IP

%CNT is set to 5.

-3 - No room in CCATEMP -5 - Required argument not specified -6 - $List identifier invalid -7 - Invalid item number

$List_Diff_Item Error Codes

Products authorizing $List_Diff_Item