Write Logic Data Screen

In the previous chapter we made many calls to ProLinga logics. Now we will write all those logics as well as adding some lines to existing ones.

Logic: Device

In a previous exercise we already created the logic called "Device" to display the screen "Device" in the "frame_main" frame. We will now add some lines to it. An explanation of the added lines are given as well.

Change the logic "Device" to this:

CLEAR TABLE Device
LET F-dateInstall.Device = DATE()
SCREEN Device CONTAINER frame_main SOURCE device_include 
DISPLAY ALL
MESSAGE "Device can be updated."
FOCUS entryDeviceNumber

On the screen "Device" we linked data references like F-deviceNumber.Device. To assure that the table buffer is empty when the screen is display and does not contain some random/old values, we first clear the table buffer "Device" with the CLEAR command.

We set the date field F-dateInstall.Device standard to today's date.

The third line remains unchanged and projects the screen Device in the frame.

The DISPLAY refreshes the contents of a screen field, by moving the contents of the data reference that is linked to it with the signal "focus_in_event" to it. By saying DISPLAY ALL we do that for all the screens. Since the data reference are table buffer entries like F-deviceNumber.Device, which we just cleared with the CLEAR command, all entries will be set to blank (or 0). So we get a nice clean data entry screen.

The MESSAGE command places all its (data references) arguments on the status/message line at the botton of the current active screen.

The FOCUS command sets the cursor to the Device Number entry field.

After you applied the changes to logic "Device", save it and run the application. See if the message becomes visible on the status/message line and if all fields are initialized.