Previous PageNext Page

Initializing a Group of Variables
If we want to initialize or re-initialize a large group of variables, how would we do so?

X1=0; X2=0; X3=0; ... X100=0;

Too much code. Instead, use this:

Array Xn{100} X1-X100 (100*0);

All 100 variables are initialized to zero. You may also initialize different variables to different values. Suppose we want to initialize each variable to its subscript value. That is, initialize X1 to 1, X2 to 2, etc.

Array Xn{100} X1-X100;
Do I=1 to 100;

Drop I;

The DO statement is covered below.

Previous PageTable Of ContentsNext Page