RAMP TSAD02 Step 2 Make Your 5250 Screen Listen to the Signal

RAMP-TS

RAMP-TSAD02 Step 2. Make Your 5250 Screen Listen to the Signal

In this step you will modify the script associated with the DisplayEmployee screen to listen for the FILTER_SIGNAL_1 and to display a message when the signal is received.

You will use the vHandle_AVEVENT function which listens for events coming from other components

1.   If the Framework is not running, start it.

2.   Start RAMP Tools and locate the script associated with the DisplayEmployee screen.

3.   Add this code just above the SYSINFO block:

/* ====================================================== */
/* ==================== AVEVENT ======================== */
/* ====================================================== */
vHandle_AVEVENT: function(WithId,Sender,WithAInfo1,WithAInfo2,WithAInfo3,WithAInfo4,WithAInfo5,WithNInfo1,WithNInfo2,WithNInfo3,WithNInfo4,WithNInfo5)
{
var sText = "";
 
if (WithId == "FILTER_SIGNAL_1")
{
sText += "RAMP script received signal " + WithId;
sText += "\r Sender = " + Sender;
sText += "\r WithAInfo1 = " + WithAInfo1;
sText += "\r WithAInfo2 = " + WithAInfo2;
sText += "\r WithAInfo3 = " + WithAInfo3;
sText += "\r WithAInfo4 = " + WithAInfo4;
sText += "\r WithAInfo5 = " + WithAInfo5;
sText += "\r WithNInfo1 = " + WithNInfo1.toString();
sText += "\r WithNInfo2 = " + WithNInfo2.toString();
sText += "\r WithNInfo3 = " + WithNInfo3.toString();
sText += "\r WithNInfo4 = " + WithNInfo4.toString();
sText += "\r WithNInfo5 = " + WithNInfo5.toString();
alert(sText);
}
return(true);
},

 

Your code should look like this:

 

4.   Commit the changes and do a partial save of the RAMP definition.