$List Conv Item: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(21 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Convert $list to single delimited $list item</span>
<span class="pageSubtitle">Convert $list to single 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_Conv_Item function is the [[CreateLines (Stringlist function)]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $List_Conv_Item function is the <var>[[CreateLines (Stringlist function)|CreateLines]]</var> function.</p>


This function converts the contents of one $list into a separator delimited string which is overlayed on a single item of a second $list.  
This function converts the contents of one $list into a separator delimited string which is overlayed on a single item of a second $list.  
Line 17: Line 17:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%result = $List_Conv_Item(list_id1, list_id2, list_item2, separator)
<p class="syntax"><span class="term">%result</span> = $List_Conv_Item(list_id1, list_id2, list_item2, separator)
<section end="syntax" /></p>
</p>
<p>
<p>
</p>
</p>
<p class="caption">%result is set either to the number of $list items overlayed on a single item in the output $list, or to a negative error code if an error has occurred.</p>
<p><var class="term">%result</var> is set either to the number of $list items overlayed on a single item in the output $list, or to a negative error code if an error has occurred.</p>




Line 99: Line 99:
<p class="code">  
<p class="code">  


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
==Products authorizing {{PAGENAMEE}}==
<li>[[Sirius functions]]</li>
<ul class="smallAndTightList">
<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>

Latest revision as of 22:51, 20 September 2018

Convert $list to single delimited $list item

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

This function converts the contents of one $list into a separator delimited string which is overlayed on a single item of a second $list.

$List_Conv_Item accepts four arguments and returns a numeric result.

The first argument is the identifier of a $list to be converted into a separator delimited $list item. This is a required argument.

The second argument is the identifier of a $list containing the item to be overlayed by the delimiter separated string generated from the first $list. This is a required argument.

The third argument is the number of the item from the second $list to be overlayed by the delimiter separated string generated from the first $list. This is a required argument.

The fourth argument is the delimiter character or characters to be used in the generated $list item string. It defaults to comma (",") and can be the null string. Specifying this argument as a null string is different from not specifying the argument at all since in the latter case it defaults to a comma.

Syntax

%result = $List_Conv_Item(list_id1, list_id2, list_item2, separator)

%result is set either to the number of $list items overlayed on a single item in the output $list, or to a negative error code if an error has occurred.


The target item in the output $list is cleared to blanks before the overlay is done. If the target item is too short to hold the input $list items, as many items and their trailing delimiters as will fit will be placed in the target item and the result of the $List_Conv_Item function will be the number of items copied. Put another way, no partial $list items will be placed into the target item. This means that a good test for success of this function is a comparison of the result of $List_Conv_Item with a $ListCnt of the input $list.

IF $List_Conv_Item(%LIST1, %LIST, %N) NE - $ListCnt(%LIST1) THEN ( error code ) END IF

For an example of the use of this function, suppose $list %LIST1 contained three items

LLL MMMMM NN

and %LIST2 contained two items

A,B,C, 123456789012345678901234567890

then

%CNT = $List_Conv_Item(%LIST1, %LIST2, 2)

will result in %LIST2 having 2 items

A,B,C, LLL,MMMMM,NN,

with the second item being blank padded to 30 characters. %CNT would be set to 3.

Suppose $list %LIST1 contained five items

EVERY GOOD BOY DOES FINE

and $list %LIST2 contained three items each padded to 22 characters.

1234567890123456789012 ***JUNK**** THE,ITSY,BITSY,SPIDER,

then

%CNT = $List_Conv_Item(%LIST1, %LIST2, 3, '++')

will result in %LIST2 having 3 items with each still padded to 22 characters.

1234567890123456789012 ***JUNK**** EVERY++GOOD++BOY++

with the third item only containing three separated entries because there was insufficient space for the item "DOES&CQ. and the item delimiter characters. %CNT would be set to 3 in this example.

The delimiter separated string generated by $List_Conv_Item can be longer than 255 bytes up to 6124 bytes in Sirius Mods Version 6.2 and later and 4096 bytes before.

-5 - Required argument not specified -6 - $List identifier invalid -7 - Invalid item number

$List_Conv_Item Error Codes

Products authorizing $List_Conv_Item