A SERVICE OF

logo

182
Appendix A: Cosmo Basic Types
To ll an array, or to retrieve values from an array, use one of the set() or get() methods
in the class, respectively, replacing <type> with the base type of the array.
void set(int i, csInt t);
void get(int i, csInt& t) const;
<type> get(int i) const;
void set(const csIntArray &l);
i is the position of the value in the array.
tis the value of that element in the array.
The second version of the set() method allows you to copy the contents of one array to
another.
You can ll an array by setting groups of values using the following methods:
void setRange(int i, int count, csInt vals[]);
void getRange(int i, int count, csInt vals[]);
void fillRange(int i, int count, csInt vals[]);
i is the position in the array where you want to begin setting values.
count is the number of array elements you want to set.
vals[] is an array of values that you want to enter into the array.
The llRange() method sets all of the values in an array to the value passed in the
argument.
The operator, [], assigns values.
<type> operator[](int i) const;
The following methods manipulate the values in the array:
void append(<type> elt);
void insert(int index, <type> elt);
int replace(csInt old, <type> elt);
int remove(<type> elt);
void removeIndex(int i);
int fastRemove(<type> elt);
void fastRemoveIndex(int i);
int find(<type> elt) const;
void write(csOutput *out);