118 Chapter 2
Agilent VEE Programming Techniques
Practice Programs
1. Select Display ⇒ Note Pad and place it at the top-center of the work
area. Click on the upper left-hand corner of the editing area to get a
cursor, then enter the following information:
Set and Get a Global Variable prompts the user to
enter a real number. The variable, num, is set to this
real number. Then num is recalled and displayed.
2. Select Data ⇒ Constant ⇒ Real64 and place it on the left side of
the work area. Open the object menu and examine the
Help entry.
3. Open the
Real64 object menu and select Properties. Change the title
to the prompt,
Enter a Real Number:, then click OK.
Note This exercise uses one of the Constant objects for an input dialog box by
simply changing its title to a prompt. This is a common technique for getting
user input. You could use
Data ⇒ Dialog Box ⇒ Real64 Input.
Also, you can double-click on the title bar to get the
Constant
Properties dialog box.
4. Select
Data ⇒ Variable ⇒ Set Variable and place it to the right
of the
Real64 object. Double-click globalA to highlight it, then enter
num. Notice the name of the object changes to Set num.
This means that the user will enter a real number in the
Real64 object.
When the user clicks the Run button, the number will be set to the global
variable,
num.
5. Connect the data output pin of the
Real object to the data input pin of the
Set num object.
6. Select
Data ⇒ Variable ⇒ Get Variable and place it below the
Set num object. Change the variable name to num. Notice the name of
the object changes to
Get num.
7. Connect the
Set num sequence output pin to the Get num sequence
input pin.