Chapter 5 237
Storing and Retrieving Test Results
Customizing a Simple Test Database
Customizing a Simple Test Database
You can search and sort a DataSet for information, such as test name, time
stampls, test parameters, test values, pass or fail indicators, and test
descriptions. Therefore,
DataSet records can act as a test database. To
search for information, you can use the
From Data Set object as follows:
n The expression field in the
From Data Set object is used for search
operations.
n The function
sort() can be used to sort records using a specified field.
Lab 5-6: Using Search and Sort Operations with
DataSets
In this exercise, you will learn how to search a DataSet for information,
create an operator interface for the search operation, and program a sort
operation.
Performing a Search Operation With DataSets
1. Open the dataset1.vee program.
2. Double-click on the expression field at the bottom of the
From Data
Set
object to highlight the current expression, 1. Enter Rec.B>=0.5.
The object will now output all records, where field
B (the random number
in our code) is greater or equal to
0.5.
3. Add an
EOF pin that will fire if no records match the criterion in the
expression field. Place the cursor over the data output area of the
From
Data Set
object, and press Ctrl-A. An EOF output pin is added to the
From Data Set object, as shown in Figure 5-16.
Note To add an EOF pin, you could also open the object menu, and click Add
Terminal ⇒ Data Output....
4. Run the program and save it as
dataset2.vee.