Implicit concatenation: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Template: New feature in 7.9 mods}}
{{Template: New feature in 7.9 mods}}
Implicit concatenation eliminates the need to precede <var class="product">User Language</var> variables (including methods chained off a variable) and literals with the word <code>With</code> to indicate concatenation. For example, the following statement sets <code>%foo</code> to the contents of <code>%test</code> enclosed within parentheses: <p class="code">%foo = "(" %test ")"</p>
Implicit concatenation eliminates the need to precede <var class="product">User Language</var> variables (including methods chained off a variable) and literals with the word <code>With</code> to indicate concatenation. For example, the following statement sets <code>%foo</code> to the contents of <code>%test</code> enclosed within parentheses:  
<p class="code">%foo = "(" %test ")"</p>


If <code>%nal</code> is a <var>Named Arraylist</var> of <var>String</var>, implicit concatenation lets you assign to <code>%foo</code> the single-quoted value of item <code>%x +1</code>:<p class="code">%foo = "'" %nal(%x + 1) "'"</p>
If <code>%nal</code> is a <var>Named Arraylist</var> of <var>String</var>, implicit concatenation lets you assign to <code>%foo</code> the single-quoted value of item <code>%x +1</code>:
<p class="code">%foo = "'" %nal(%x + 1) "'"</p>
 
<var>With</var> is still required before field names:
<p class="code">%foo = '>>' with field name </p>                                   
                                                                       
And <var>With</var> is still required before expressions in parentheses:
<p class="code">%foo = '>>' with (%x + 2) </p>                                           


[[Category:User Language syntax enhancements]]
[[Category:User Language syntax enhancements]]

Revision as of 19:50, 5 December 2011

This feature is new in version 7.9 of the Sirius Mods.

Implicit concatenation eliminates the need to precede User Language variables (including methods chained off a variable) and literals with the word With to indicate concatenation. For example, the following statement sets %foo to the contents of %test enclosed within parentheses:

%foo = "(" %test ")"

If %nal is a Named Arraylist of String, implicit concatenation lets you assign to %foo the single-quoted value of item %x +1:

%foo = "'" %nal(%x + 1) "'"

With is still required before field names:

%foo = '>>' with field name

And With is still required before expressions in parentheses:

%foo = '>>' with (%x + 2)