RAMP-TSAD01 Step 3. Add a Function to the Script for the DisplayEmployee Screen
In this step you will a function in the script for DisplayEmployee to copy the contents of the Employee, Givename and Surname fields to the Windows clipboard.
1. Locate the script for the DisplayEmployee destination screen.
2. Copy and paste the following function to the script after the NavigateTo function, before the //<SYSINFO> block:
/* ====================================================== */
/* =================== uCopyEmpDetails ================ */
/* ====================================================== */
/* Copies Employee Details to the Windows Clipboard */
uCopyEmpDetails : function () {
/* Get details from 5250 screen */
var TAB_Char = "\x09" ;
var End_Of_Line_Char = "\x0D\x0A" ;
var strEmpno = GETVALUE("txtEmpno");
var strGName = GETVALUE("txtGivename");
var strSName = GETVALUE("txtSurname");
/* Write details to clipboard */
var MyString = "";
MyString = strEmpno + TAB_Char + strGName + TAB_Char + strSName + End_Of_Line_Char;
COPYTOCLIPBOARD(MyString);
/* Issue a message */
MESSAGE("Details for employee ", strEmpno," sent to the clipboard");
} ,
3. Use the Commit Changes button to commit the changes to the script.