http://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&feed=atom&action=historyBasic Language Mechanisms - Revision history2024-03-28T13:24:21ZRevision history for this page on the wikiMediaWiki 1.25.3http://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=1268&oldid=prevRob at 11:29, 4 December 20082008-12-04T11:29:22Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 11:29, 4 December 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{context|<del class="diffchange diffchange-inline">Basic Concepts and Terminology|Scripting Language|Language Basics</del>}}</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{context|<ins class="diffchange diffchange-inline">Kit Reference</ins>}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td></tr>
</table>Robhttp://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=617&oldid=prevRob at 08:31, 22 November 20082008-11-22T08:31:47Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 08:31, 22 November 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">[[Category:</del>Basic Concepts and Terminology<del class="diffchange diffchange-inline">]]</del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{context|</ins>Basic Concepts and Terminology|Scripting Language<ins class="diffchange diffchange-inline">|</ins>Language Basics<ins class="diffchange diffchange-inline">}}</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">[Context: [[Home</del>|<del class="diffchange diffchange-inline">HL Kit]] &#133; [[Basic Concepts and Terminology]] &#133; [[</del>Scripting Language<del class="diffchange diffchange-inline">]] &#133; [[</del>Language Basics<del class="diffchange diffchange-inline">]]]</del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td></tr>
</table>Robhttp://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=507&oldid=prevRob at 13:52, 21 November 20082008-11-21T13:52:38Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:52, 21 November 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L23" >Line 23:</td>
<td colspan="2" class="diff-lineno">Line 23:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|The scripting language will automatically convert a variable or attribute between the two types when necessary. If you assign a numeric variable to a string, the value is converted to a string automatically (e.g. the value 521 is converted to the string "521"). Conversely, assigning a string variable to a number converts the string before the assignment takes place. However, going from a string to a number only converts the '''leading''' numeric portion of the string, so the string "1234hello789" is converted to the value 1234.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|The scripting language will automatically convert a variable or attribute between the two types when necessary. If you assign a numeric variable to a string, the value is converted to a string automatically (e.g. the value 521 is converted to the string "521"). Conversely, assigning a string variable to a number converts the string before the assignment takes place. However, going from a string to a number only converts the '''leading''' numeric portion of the string, so the string "1234hello789" is converted to the value 1234.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><span class="</del>important<del class="diffchange diffchange-inline">">IMPORTANT!</span> </del>Type casting only occurs with individual variables/attributes and not with entire expressions. Therefore, it is not valid to assign an arithmetic expression to a string, although it is valid to use a string variable within an arithmetic expression. If you want to assign an arithmetic expression to a string variable, you must first assign the expression result to a numeric variable and then assign that variable to the string. Similarly, it is valid to use a string variable as a parameter to an intrinsic function where a number is required, or vice versa.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{</ins>important<ins class="diffchange diffchange-inline">}}</ins>Type casting only occurs with individual variables/attributes and not with entire expressions. Therefore, it is not valid to assign an arithmetic expression to a string, although it is valid to use a string variable within an arithmetic expression. If you want to assign an arithmetic expression to a string variable, you must first assign the expression result to a numeric variable and then assign that variable to the string. Similarly, it is valid to use a string variable as a parameter to an intrinsic function where a number is required, or vice versa.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
</table>Robhttp://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=264&oldid=prevRob at 09:03, 18 November 20082008-11-18T09:03:29Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 09:03, 18 November 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Basic Concepts and Terminology]]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Basic Concepts and Terminology]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[Context: [[Home|HL Kit]] &#133; [[Basic Concepts and Terminology]] &#133; [[Scripting Language]]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[Context: [[Home|HL Kit]] &#133; [[Basic Concepts and Terminology]] &#133; [[Scripting Language<ins class="diffchange diffchange-inline">]] &#133; [[Language Basics</ins>]]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The scripting language supports the following basic language mechanisms:</div></td></tr>
</table>Robhttp://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=247&oldid=prevRob at 03:33, 18 November 20082008-11-18T03:33:39Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 03:33, 18 November 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Numeric Assignment</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Numeric Assignment</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|<del class="diffchange diffchange-inline">Two </del>additional assignment behaviors are supported that are exclusive to numeric values. <del class="diffchange diffchange-inline">One is </del>the increment ("+=") assignment and <del class="diffchange diffchange-inline">the other is the </del>decrement ("–=") assignment. Both are essentially a shorthand notation for the statements "x=x+y" and "x=x–y", respectively. Consequently, the statement "x+=y" is equivalent to "x=x+y". This can be incredibly convenient when identifiers are used with lengthy context transitions and target references.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|<ins class="diffchange diffchange-inline">Four </ins>additional assignment behaviors are supported that are exclusive to numeric values. <ins class="diffchange diffchange-inline">The first two are </ins>the increment ("+=") assignment and decrement ("–=") assignment. Both are essentially a shorthand notation for the statements "x=x+y" and "x=x–y", respectively. Consequently, the statement "x+=y" is equivalent to "x=x+y"<ins class="diffchange diffchange-inline">. The other two are the multiply ("*=") assignment and divide ("/=") assignment, which are a shorthand for the statements "x=x*y" and "x=x/y", respectively</ins>. This <ins class="diffchange diffchange-inline">assignment syntax </ins>can be incredibly convenient when identifiers are used with lengthy context transitions and target references.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|String Assignment</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|String Assignment</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|One additional assignment <del class="diffchange diffchange-inline">behaviors </del>is supported that is exclusive to string values. It is the concatenate ("&=") assignment, which is essentially a shorthand notation for the statement "x=x&y". Consequently, the statement "x&=y" is equivalent to "x=x&y". This can be incredibly convenient when identifiers are used with lengthy context transitions and target references.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|One additional assignment <ins class="diffchange diffchange-inline">behavior </ins>is supported that is exclusive to string values. It is the concatenate ("&=") assignment, which is essentially a shorthand notation for the statement "x=x&y". Consequently, the statement "x&=y" is equivalent to "x=x&y". This can be incredibly convenient when identifiers are used with lengthy context transitions and target references.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Arithmetic Expressions</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Arithmetic Expressions</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|Complex arithmetic expressions are fully supported by the scripting language. All of the standard operators are supported (+–*/), as is the use of parentheses to control the order of evaluation in an expression. An additional operator (%) is supported, which returns the remainder after dividing x by y (also called the "modulus").</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|Complex arithmetic expressions are fully supported by the scripting language. All of the standard operators are supported (+–*/), as is the use of parentheses to control the order of evaluation in an expression. An additional operator (%) is supported, which returns the remainder after dividing <ins class="diffchange diffchange-inline">"</ins>x<ins class="diffchange diffchange-inline">" </ins>by <ins class="diffchange diffchange-inline">"</ins>y<ins class="diffchange diffchange-inline">" </ins>(also called the "modulus").</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|String Expressions</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|String Expressions</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="L21" >Line 21:</td>
<td colspan="2" class="diff-lineno">Line 21:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Implicit Type Casting</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|Implicit Type Casting</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|The scripting language will automatically convert a variable or attribute between the two types when necessary. If you assign a numeric variable to a string, the value is converted to a string automatically (e.g. the value 521 is converted to the string "521"). Conversely, assigning a string variable to a number converts the string before the assignment takes place. However, going from a string to a number only converts the leading numeric portion of the string, so the string "1234hello789" is converted to the value 1234.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|The scripting language will automatically convert a variable or attribute between the two types when necessary. If you assign a numeric variable to a string, the value is converted to a string automatically (e.g. the value 521 is converted to the string "521"). Conversely, assigning a string variable to a number converts the string before the assignment takes place. However, going from a string to a number only converts the <ins class="diffchange diffchange-inline">'''</ins>leading<ins class="diffchange diffchange-inline">''' </ins>numeric portion of the string, so the string "1234hello789" is converted to the value 1234.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Type casting only occurs with individual variables/attributes and not with entire expressions. Therefore, it is not valid to assign an arithmetic expression to a string, although it is valid to use a string variable within an arithmetic expression. If you want to assign an arithmetic expression to a string variable, you must first assign the expression result to a numeric variable and then assign that variable to the string. Similarly, <del class="diffchange diffchange-inline">is </del>it valid to use a string variable as a parameter to an intrinsic function where a number is required, or vice versa.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"><span class="important">IMPORTANT!</span> </ins>Type casting only occurs with individual variables/attributes and not with entire expressions. Therefore, it is not valid to assign an arithmetic expression to a string, although it is valid to use a string variable within an arithmetic expression. If you want to assign an arithmetic expression to a string variable, you must first assign the expression result to a numeric variable and then assign that variable to the string. Similarly, it <ins class="diffchange diffchange-inline">is </ins>valid to use a string variable as a parameter to an intrinsic function where a number is required, or vice versa.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|-</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>|}</div></td></tr>
</table>Robhttp://hlkitwiki.wolflair.com/index.php5?title=Basic_Language_Mechanisms&diff=246&oldid=prevRob: New page: Category:Basic Concepts and Terminology [Context: HL Kit … Basic Concepts and Terminology … Scripting Language] The scripting language supports the followin...2008-11-18T03:27:08Z<p>New page: <a href="/index.php5?title=Category:Basic_Concepts_and_Terminology&action=edit&redlink=1" class="new" title="Category:Basic Concepts and Terminology (page does not exist)">Category:Basic Concepts and Terminology</a> [Context: <a href="/index.php5?title=Home" title="Home">HL Kit</a> <a href="/index.php5?title=Basic_Concepts_and_Terminology" title="Basic Concepts and Terminology">Basic Concepts and Terminology</a> <a href="/index.php5?title=Scripting_Language&action=edit&redlink=1" class="new" title="Scripting Language (page does not exist)">Scripting Language</a>] The scripting language supports the followin...</p>
<p><b>New page</b></p><div>[[Category:Basic Concepts and Terminology]]<br />
[Context: [[Home|HL Kit]] &#133; [[Basic Concepts and Terminology]] &#133; [[Scripting Language]]]<br />
<br />
The scripting language supports the following basic language mechanisms:<br />
<br />
:{| class="infotable"<br />
|class="leftnormal"|Assignment<br />
|Variables and attributes can be assigned values from other variables, attributes, and literal values. Assignment statements typically take the traditional form "x = y".<br />
|-<br />
|Numeric Assignment<br />
|Two additional assignment behaviors are supported that are exclusive to numeric values. One is the increment ("+=") assignment and the other is the decrement ("–=") assignment. Both are essentially a shorthand notation for the statements "x=x+y" and "x=x–y", respectively. Consequently, the statement "x+=y" is equivalent to "x=x+y". This can be incredibly convenient when identifiers are used with lengthy context transitions and target references.<br />
|-<br />
|String Assignment<br />
|One additional assignment behaviors is supported that is exclusive to string values. It is the concatenate ("&=") assignment, which is essentially a shorthand notation for the statement "x=x&y". Consequently, the statement "x&=y" is equivalent to "x=x&y". This can be incredibly convenient when identifiers are used with lengthy context transitions and target references.<br />
|-<br />
|Arithmetic Expressions<br />
|Complex arithmetic expressions are fully supported by the scripting language. All of the standard operators are supported (+–*/), as is the use of parentheses to control the order of evaluation in an expression. An additional operator (%) is supported, which returns the remainder after dividing x by y (also called the "modulus").<br />
|-<br />
|String Expressions<br />
|Strings can be concatenated together through string expressions. To concatenate two strings, use the '&' operator (e.g. "str1 & str2"). No other string operators are supported.<br />
|-<br />
|Implicit Type Casting<br />
|The scripting language will automatically convert a variable or attribute between the two types when necessary. If you assign a numeric variable to a string, the value is converted to a string automatically (e.g. the value 521 is converted to the string "521"). Conversely, assigning a string variable to a number converts the string before the assignment takes place. However, going from a string to a number only converts the leading numeric portion of the string, so the string "1234hello789" is converted to the value 1234.<br />
<br />
Type casting only occurs with individual variables/attributes and not with entire expressions. Therefore, it is not valid to assign an arithmetic expression to a string, although it is valid to use a string variable within an arithmetic expression. If you want to assign an arithmetic expression to a string variable, you must first assign the expression result to a numeric variable and then assign that variable to the string. Similarly, is it valid to use a string variable as a parameter to an intrinsic function where a number is required, or vice versa.<br />
|-<br />
|}<br />
<br />
The following sample code demonstrates the basic language mechanisms in use:<br />
<br />
<pre><br />
~Declare a variable and put a number into it.<br />
var myint as number<br />
myint = 7<br />
<br />
~Declare another variable and set it equal to an arithmetic expression.<br />
var temp as number<br />
temp = (myint + 100) * 3<br />
<br />
~Decrement temp by the value of "myint" times three.<br />
temp -= myint * 3<br />
<br />
~Set the value of a string to a numeric value, converting it to a string.<br />
var mystr as string<br />
mystr = temp<br />
<br />
~Append the contents of two strings<br />
mystr = "123" & mystr<br />
<br />
~Append text to the end of the current string<br />
mystr &= "123"<br />
<br />
~Set a numeric variable to a string, automatically converting the result.<br />
myint = mystr<br />
</pre></div>Rob