CCATSL provides two useful routines allowing the user to
enter and edit
arrays of doubles and ints: EditDoubleArrayCL and
EditIntArrayCL.
EditDoubleArrayCLdouble array in a CCATSL window and gives
the user the opportunity to edit the entries.
| void EditDoubleArrayCL ( |
int x, |
| int y, |
|
| int field, |
|
| int ndec, |
|
| two_d_double_array ap, |
|
| int nrows, |
|
| int ncols, |
|
| int nTotalCols); |
|
| x, y |
The text-coordinates of the position for the top-left corner of the array. | |
| field |
The field-width to use when printing each array entry. | |
| ndec |
The number of decimal places to display. | |
| ap |
The array of doubles, defined as type typedef double two_d_double_array[][]. |
|
| nrows, ncols |
The number of rows and columns to print. Usually
nrows is the size of the first dimension in the declaration
of the array ap, and ncols the second. |
|
| nTotalCols |
The size of the second dimension in the declaration
of the array ap. |
For example:
|
..
{
double r[5][10];
EditDoubleArrayCL(
1, 1, /* print in the top-left corner */
4, 1, /* field width and decimal places */
r,
5, 10, 10); /* array dimensions */
}
|
EditIntArrayCLint array in a CCATSL window and gives
the user the opportunity to edit the entries.
| void EditIntArrayCL ( |
int x, |
| int y, |
|
| int field, |
|
| two_d_int_array ap, |
|
| int nrows, |
|
| int ncols, |
|
| int nTotalCols); |
|
| x, y |
The text-coordinates of the position for the top-left corner of the array. | |
| field |
The field-width to use when printing each array entry. | |
| ap |
The array of ints, defined as type typedef int two_d_int_array[][]. |
|
| nrows, ncols |
The number of rows and columns to print. Usually
nrows is the size of the first dimension in the declaration
of the array ap, and ncols the second. |
|
| nTotalCols |
The size of the second dimension in the declaration
of the array ap. |
Example:
|
..
{
double r[5][10];
EditDoubleArrayCL(
1, 1, /* print in the top-left corner */
4, 1, /* field width and decimal places */
r,
5, 10, 10); /* array dimensions */
}
|
If the array has only one dimension pass its address:
|
..
{
double r[5][10];
EditDoubleArrayCL(
1, 1, /* print in the top-left corner */
4, 1, /* field width and decimal places */
r,
5, 10, 10); /* array dimensions */
}
|