Let's create an action subroutine for the OK push button. This action changes the color of the entry field when it is selected during program execution. If the current background color is not red, it changes to red when it is selected. If the entry field button is already red, it changes to gray when it is selected.
The ability to change colors many not seem useful, but it gives you an opportunity to experiment with the new operation codes. Later we will add some more logic to the PRESS event for this push button. Let's add the logic for the OK push button.
Follow these steps:
Use the Editor to insert six blank lines between the
BEGACT and ENDACT lines. Move the cursor to this line in the source and press F4(Prompt).
Select the C-Calculation radio button. Click OK.
Remember to change the type of specification as required.
CSRN01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq * C 'CUSTNO' Getatr 'BackColor' BCOLOR 2 0 C If BCOLOR <> *RED C 'CUSTNO' Setatr *RED 'BackColor' C Else C 'CUSTNO' Setatr *PALEGRAY 'BackColor' C EndIf