https://wiki.beyondunreal.com/w/index.php?action=history&feed=atom Static arrays - Revision history 2017-11-18T02:58:38Z Revision history for this page on the wiki MediaWiki 1.25.1 https://wiki.beyondunreal.com/Static_arrays?diff=45465&oldid=prev 69.127.24.223: /* Usage */ >.< 2013-09-06T18:44:44Z <p>‎<span dir="auto"><span class="autocomment">Usage: </span> &gt;.&lt;</span></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 18:44, 6 September 2013</td> </tr><tr><td colspan="2" class="diff-lineno" id="L13" >Line 13:</td> <td colspan="2" class="diff-lineno">Line 13:</td></tr> <tr><td class='diff-marker'>&#160;</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>To access an element of a static array, simply specify the name of the static array variable and append the element's index in square brackets:</div></td><td class='diff-marker'>&#160;</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>To access an element of a static array, simply specify the name of the static array variable and append the element's index in square brackets:</div></td></tr> <tr><td class='diff-marker'>&#160;</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>&#160; ''varname'''''['''''index''''']'''</div></td><td class='diff-marker'>&#160;</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>&#160; ''varname'''''['''''index''''']'''</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>Valid index values are positive integer values smaller than the array's length, i.e. 0 to ArrayCount(''varname'')-1. <del class="diffchange diffchange-inline">Aarry </del>elements referenced this way are [[wp:lvalue|lvalue]]s, i.e. they can be used on the left side of an assignment or as ''out'' parameter in a function call.</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>Valid index values are positive integer values smaller than the array's length, i.e. 0 to ArrayCount(''varname'')-1. <ins class="diffchange diffchange-inline">Array </ins>elements referenced this way are [[wp:lvalue|lvalue]]s, i.e. they can be used on the left side of an assignment or as ''out'' parameter in a function call.</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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'>&#160;</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>==ArrayCount==</div></td><td class='diff-marker'>&#160;</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>==ArrayCount==</div></td></tr> </table> 69.127.24.223 https://wiki.beyondunreal.com/Static_arrays?diff=45464&oldid=prev 69.127.24.223: /* Usage */ 2013-09-06T18:44:25Z <p>‎<span dir="auto"><span class="autocomment">Usage</span></span></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 18:44, 6 September 2013</td> </tr><tr><td colspan="2" class="diff-lineno" id="L13" >Line 13:</td> <td colspan="2" class="diff-lineno">Line 13:</td></tr> <tr><td class='diff-marker'>&#160;</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>To access an element of a static array, simply specify the name of the static array variable and append the element's index in square brackets:</div></td><td class='diff-marker'>&#160;</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>To access an element of a static array, simply specify the name of the static array variable and append the element's index in square brackets:</div></td></tr> <tr><td class='diff-marker'>&#160;</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>&#160; ''varname'''''['''''index''''']'''</div></td><td class='diff-marker'>&#160;</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>&#160; ''varname'''''['''''index''''']'''</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>Valid index values are positive integer values smaller than the array's length, i.e. 0 to ArrayCount(''varname'')-1. <del class="diffchange diffchange-inline">Arry </del>elements referenced this way are [[wp:lvalue|lvalue]]s, i.e. they can be used on the left side of an assignment or as ''out'' parameter in a function call.</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>Valid index values are positive integer values smaller than the array's length, i.e. 0 to ArrayCount(''varname'')-1. <ins class="diffchange diffchange-inline">Aarry </ins>elements referenced this way are [[wp:lvalue|lvalue]]s, i.e. they can be used on the left side of an assignment or as ''out'' parameter in a function call.</div></td></tr> <tr><td class='diff-marker'>&#160;</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'>&#160;</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'>&#160;</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>==ArrayCount==</div></td><td class='diff-marker'>&#160;</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>==ArrayCount==</div></td></tr> </table> 69.127.24.223 https://wiki.beyondunreal.com/Static_arrays?diff=33342&oldid=prev Wormbo: New page: A '''static array''' is a composite data type in UnrealScript that groups multiple values of the same type. Static arrays, as opposed to dynamic arrays, have a fixed length that is... 2008-11-17T11:06:53Z <p>New page: A &#039;&#039;&#039;static array&#039;&#039;&#039; is a composite data type in <a href="/UnrealScript" title="UnrealScript">UnrealScript</a> that groups multiple values of the same type. Static arrays, as opposed to <a href="/Dynamic_arrays" title="Dynamic arrays">dynamic arrays</a>, have a fixed length that is...</p> <p><b>New page</b></p><div>A '''static array''' is a composite data type in [[UnrealScript]] that groups multiple values of the same type. Static arrays, as opposed to [[dynamic arrays]], have a fixed length that is specified as a constant value at compile time.<br /> <br /> ==Declaration==<br /> Class properties, struct members, function parameters and local variables can be declared as static arrays by simply appending the array length in square brackets after the variable name:<br /> '''var''' ''type varname'''''['''''length'''''];'''<br /> The type can be any other UnrealScript [[type]], with the exception of type ''bool'' and dynamic array types. Note that the compiler will not complain about dynamic array types and just silently use the dynamic array's base type instead!<br /> <br /> Because the array length is specified as part of the variable name, it is possible to mix static arrays and non-array variables in a single declaration. The length can be any integer constant, including the [[ArrayCount]] pseudo function.<br /> <br /> This kind of declaration also has an important implication: It is not possible to use static arrays as the return type of a function. You can get around that by using an ''out'' parameter instead.<br /> <br /> ==Usage==<br /> To access an element of a static array, simply specify the name of the static array variable and append the element's index in square brackets:<br /> ''varname'''''['''''index''''']'''<br /> Valid index values are positive integer values smaller than the array's length, i.e. 0 to ArrayCount(''varname'')-1. Arry elements referenced this way are [[wp:lvalue|lvalue]]s, i.e. they can be used on the left side of an assignment or as ''out'' parameter in a function call.<br /> <br /> ==ArrayCount==<br /> The '''ArrayCount''' pseudo-function can be used to get the length of a static array. Note that it is actually evaluated at compile time and replaced by an integer value in the [[UnrealScript bytecode]]. As such it can be used even with a complex argument and is guaranteed to never throw any runtime warnings. Also, because it's not really a function call, ArrayCount can be used as the value of [[constants]] and as the length value of other static array declarations.<br /> '''ArrayCount('''''staticarrayreference''''')'''<br /> The static array reference could be as simple as the name of a static array variable in the same class or function or a more complex expression, such as &lt;code&gt;class'TeamAI'.default.[[UE2:TeamAI (UT2004)#OrderList|OrderList]]&lt;/code&gt;.<br /> <br /> {{navbox unrealscript}}</div> Wormbo