RAMP-TSAD01 ステップ3. DisplayEmployee画面のスクリプトにファンクションを追加する

LANSA RAMP-TS

RAMP-TSAD01 ステップ3. DisplayEmployee画面のスクリプトにファンクションを追加する


このステップでは、DisplayEmployeeのスクリプトにファンクションを追加して、[社員]、[姓]、[名]フィールドの内容をWindowsクリップボードにコピーします。

1.    DisplayEmployee Destination画面のスクリプトを見つけます。

2.    以下のファンクションをNavigateToファンクションの後、//<SYSINFO>ブロックの前のスクリプトにコピーして貼り付けます。

   /* ====================================================== */
   /* ===================  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.    [変更をコミット]ボタンを使用して、スクリプトの変更をコミットします。