Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

11.3.5 Creating the Timer Control Event Procedure

You are now ready to create the event procedure for the timer control. This is the only event procedure needed to implement the clock control.

The timer control is currently configured to generate a timer event every 500 msec. You need to create an event procedure for this event that will simply get the current time from the system and display it in the static text control. That's all there is to implementing this control.

Move the mouse over the timer control and right-click on it. Move the mouse over Edit the event procedure in the pop-up menu to bring up a second pop-up menu. Left-click on Timer.

This will bring up the event procedure for the timer event in the PowerCOBOL editor. Enter the following code:

Figure 11.7 The event procedure for the timer event

You will note that we have chosen to use a COBOL intrinsic function to retrieve the current time. You could have just as easily used the COBOL ACCEPT ...FROM TIME function.

We have chosen to use the intrinsic function, as it returns a great deal more of information that you will use to enhance the functionality of this control later.

Save the event procedure and exit the form editor. Go back to the PowerCOBOL project Manager for your project.

The project manager window should now appear as follows:

Figure 11.8 The Project Manager window after creating the event procedure for the timer event