Arraylist class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 3: Line 3:
much more flexibility.
much more flexibility.
    
    
The following code illustrates several of the Arraylist methods:
The following code shows several of the <var>Arraylist</var> methods:
<p class="code">%alist  is collection Arraylist of longstring
<p class="code">%alist  is collection Arraylist of longstring
%i      is float
%i      is float
Line 30: Line 30:


==See also==
==See also==
<table>
<ul>
<tr><th>[[Collections]]</th>
<li>[[Collections|"Collections"]], for background information about collections and <var>Arraylist</var>s and about
<td>For background information about collections and <var>Arraylist</var>s and about
declaring <var>Arraylist</var> object variables.
declaring <var>Arraylist</var> object variables.</td></tr>
 
<tr><th>[[Collections#Coding considerations for collections|Coding
<li>[[Collections#Coding considerations for collections|"Coding considerations for collections"]], for tips on using collections.
considerations for collections]]</th>
</ul>
<td>For tips on using collections.</td></tr>
</table>


[[Category:System classes]]
[[Category:System classes]]

Revision as of 22:03, 12 November 2012

Arraylists can be thought of as traditional arrays with no bounds and much more flexibility.

The following code shows several of the Arraylist methods:

%alist is collection Arraylist of longstring %i is float %alist = new %alist:add('Idle') %alist:add('Gumby') %alist:add('Chapman') %alist:add('Pallin') %alist:insert(2, 'Jones') %alist:removeItem(4) %alist(3) = 'Cleese' for %i from 1 to %alist:count print %alist(%i) end for

This code snippet would print:

Idle Jones Cleese Pallin

List of Arraylist methods

The "List of Arraylist methods" shows all the class methods, with a brief description of each.

See also