Step 2. Use a SELECTLIST Command
FRM075 - Using a Working List
In this step you will add another copy of the iiiTOTSAL field to the form and a push button. Clicking the push button will read through the
EMPLOYS using a SELECTLIST/ENDSELECT command and total the currently selected entries into the new total field.1. Drop a Compute Selected.
onto the right hand side of your form. Resize it and change its property to2. Drag and drop field iiiTOTSAL into the group box. Note that it will be renamed to iiiTOTSAL_1. Changes its Top.
to3. Drag and drop a push button into the group box.
Change its COMPUTE and to Calc. Total Salary.
toCreate a COMPUTE.Click event routine.
Your form should look like the following:
4. In this step you will complete the COMPUTE click event logic.
a. SELECTLIST/ENDSELECT will read all entries in a list component.
b. The selected entries can be identified by using their true or false).
property. Entries in a list are themselves a component. has a property (c. Use F2 Feature help on a component to discover all its events, properties and methods and the help associated with each of these.
d. Double-click PRIM_LVIT to see the events, properties and methods of a list item:
e. Expand the list item properties and choose the Selected property to see its description:
The following code will accumulate SALARY into iiiTOTSAL for selected items:
Evtroutine Handling(#COMPUTE.Click)
#iiitotsal_1 := *zeroes
Selectlist
If (#EMPLOYS.currentItem.selected = true)
#IIITOTSAL_1 += #salary
Endif
Endselect
Endroutine
5. Compile and test your form: