| |
|
|
| |
Implementation
01 ''
02 '' CONTAINER CLASS
03 ''
04 '' A versatile container class based on a custom implementation of a vector
05 '' style array. The container class wraps around a purely dynamic array
06 '' which automatically expands when more storage space is needed. The vector
07 '' has a lazy implementation which doesn't size down the internal buffer when
08 '' removing elements from the end. The container class may be too slow for
09 '' if you want to perform many insertions around the begining (typical vector
10 '' side effect); a linked list style container maybe more suitable. The class
11 '' has function so it can be used as a stack.
12 ''
13 '' Example:
14 '' dim vector: set vector = new container
15 '' dim index
16 '' for index = 0 to 11
17 '' call vector.append( index )
18 '' call msgbox( "array:" + vector.print( ) + _
19 '' " size:" + cstr( vector.length( ) ) )
20 '' next
21 ''
22 ''
23 class container
24
25 '' Members of the container class
26 ''
27 public elements
28 public capacity
29 public increment
30 public pointer
31
|
|
| |
|
|

|