2.3 Adding Constants and Fields
Next we will be adding the
customer number, field, title, date, time, and function keys to the record which will be
the Customer Inquiry screen. On the bottom left-hand side of the design area is the
palette. The palette contains icons for creating records, fields and constants. To find
out the function of an icon, place your mouse over each icon in the palette to obtain
fly-over help.
Adding Some Constants and Fields
Follow these steps:
- Select the record FMT01
from the right-hand pane of the CODE Designer window.
- Right-click on the record and
select Design from the pop-up menu. The Design page appears containing a
record.
- From the palette, click on the
date constant icon
.
- Position the cursor in the
upper-left corner of the Design area and left-click. A new date field is added to the
screen.
- From the palette, click on the
system constant
. Position the
cursor in the upper-right corner of the Design area and left-click. A new system constant
is added to the screen.
- In order to create multiple text
constants, enable the sticky checkbox
from the palette and then click on the text constant
on the palette.
- Position the cursor in the
top-center of the Design area and left-click. A new text constant is added to the screen.
- Select Selected >
Properties to bring up the Properties notebook for the text constant.
- In the Properties notebook, select
the Basics page for the text constant.
- In the Text
field, type in the name Customer Inquiry.
- Select the Color
tab.
- Click on the white icon and click Add.
Close the Properties notebook.
Creating Another Text Constant
You need to add another text
constant and field for the Customer Number.
Follow these steps:
- Click on the Design area a few
lines down from where you created the Customer Inquiry text constant to create another
text constant.
- Select Selected >
Properties to bring up the Properties notebook for the text constant.
- In its properties notebook, type Enter
a customer number and press Enter in the Text field.
- Select the Color
tab.
- Click on the blue icon and click Add.
- Click on the Design area a few
lines down from where you created the last constant.
- In the Properties notebook, select
the Basics page for the text constant.
- Type Customer Number
in the Text field. Press Enter.
- Click on the Design area to the
right of the Customer Number text constant (leaving enough space for a 7 digit customer
number).
- In its properties notebook, type Number,
F4 for list in the Text field. Press Enter. Close
the Properties notebook.
Adding Function Keys
Next you need to add some
function keys to the Customer Inquiry screen.
Follow these steps:
- To enter the function keys for the
Customer Inquiry screen, click on the bottom portion of the Design area to create a new
text constant. If your Design area is small you may need to use the scroll bar to move to
the bottom of the Design area.
- Select Selected >
Properties to bring up the Properties notebook for the text constant.
- In its properties notebook, type F3=Exit,
F4=Prompt, F6=Print, F12=Cancel in the Text field. Press Enter.
Close the Properties notebook.
- From the palette, disable the
sticky checkbox. Now, click each text constant and left align them. You may notice another
text constant added when you click on the Design area again. Delete this text constant as
it is not needed.
- From the palette, click on the named
field icon and click on the Design area to the right of the Customer Number text
constant.
- Right click to bring up the
Properties notebook. Type CUSTNO in the Field field.
- For its Type,
click on the character icon.
- For its Usage,
click on the B icon for this constant to accept both input and output.
- Set the Total
length to 7. Leave the specified row and column position.
- Close the properties notebook. The
Design area looks like the following:
Verifying the DDS Logic
Now you can check to make sure
the DDS logic is correct before continuing.
Follow these steps:
- Select the FMT01
record from the DDS Tree.
- Select Tools > Verify
file or use the Verify file icon
.
- Select the Listing
tab and scroll down to the bottom of the page. If there are errors, they will be listed
here. You can also select the Error List tab to check the errors. Fix any
errors before you continue.
The only error you may receive is
for the ALTHELP keyword. You can ignore the message or you can delete the
ALTHELP keyword. To delete the ALTHELP keyword select File Keywords in
the DDS tree. You can then select the keyword and delete it. When you verify the DDS again
after the change, you will receive no error messages.
Click on
to indicate that you've done all the steps.