![]()
|
|
|
REFERENCES : LABVIEW LabVIEW example: loop autoidexing
|
|
|
|
|
Left loop enter has initialized field with five integers. Loop goes from 0 to 4 and gets filled
with random values between 0 and 1. After that, right loop calculates the sum of that field.
There are some important things to note in this case:
- right loop counter (N) is not initialized,
- variable "i" is not connected with the field (G programming language doesn’t need that
since it recognized field size),
- line presenting field is lighter in the right loop. It is because of field autoindexing, which
is why the variable has not been connected.
C programming language sequence for this example is:
for (i=0; i<5; i++)
array[i] = random();
sum = 0;
for (i=0; i<5; i++)
sum += array[i];
Next example | Introduction to G programming language Please, send your comments or suggestions to: Armin.Stranjak@fer.hr
Copyright 1997. RASIP - Computer Systems and Processes. |