234 Chapter 5
Storing and Retrieving Test Results
Using DataSets to Store and Retrieve Records
8. Run the program. It should put an array of ten records into the DataSet
called
myFile, as shown in Figure 5-14.
Figure 5-14. Storing an Array of Records in a DataSet
Now retrieve the array of records and display it using the From DataSet
and
Record Constant objects.
9. Select
I/O ⇒ From ⇒ DataSet and place the object below For
Count
. Leave the default file name, myFile. Click the Get Records
field to toggle from
One to All. Finally, leave the default of 1 in the
expression field at the bottom.
With these settings, VEE looks at the DataSet in
myFile and finds all the
records that fit the criterion in the expression field. If you set
Get
Records
to One, VEE would output the first record that met the criterion
in the expression field. The
1 signifies a TRUE condition meaning that all
of the records fit the criterion, so the entire array of records in the file will
be put on the output pin labeled
Rec. Other uses of the expression field
are explained in other exercises. Consult
Help in the object menu for
more information.
Connect the
For Count sequence output pin to the sequence input on
the
From Data Set object. This ensures the part of the program that
sends data to
myFile executes before the data is read from the file. You
can turn on
Show Data Flow to show the order of events.