Write Logic Device Search Screen

During the painting of the "Device Search" screen, we made many calls to ProLinga logics. We will now write all those logics.

In the logics we need to be able to find out if the user presses OK or Cancel when closing the screen. For that we create a Variable (V-) called "accept". This will be of a boolean type that can accept a "True" and "False" value. If you are unsure how to create a Variable, look back a couple of chapters where we created the Variable "isPresentDevice". Do exactly the same, only this time name it "accept".

Logic: SearchDeviceNumber

When the user presses the "Find" button from the "Device" screen, we created an error message that this functionality has not been implemented. Open this function and replace the logic with the following one:

LET V-accept = FALSE()
LET G-deviceNumber.Search = "*"
SCREEN DeviceSearch
IF V-accept = TRUE()
	DISPLAY entryDeviceNumber

What we do here is to initialize the variable and variable group entry and then we call the screen "DeviceSearch". As soon as the user leaves this screen we check if the user pressed OK by testing the "V-accept" variable. In that case we want to display the selected value in the Device Number field.