PASSPORT Knowledge Base
Macros

Date Published: October 2, 2002
Date Updated: March 7, 2008

Title

Move Data Between Sessions

Product

PASSPORT PC to Host, PASSPORT Web to Host

Emulation Types

TN3270, TN5250, VT, SCO ANSI, Wyse 60

Issue

When using a macro, can I move data or text from one open session to another?

Solution

This is possible using the PASSPORT Object API (PASSOBJ.DLL).

Example

Below is a sample PASSPORT macro that copies an area of text from one session, pastes it into a specific area of a second session, then issues an ENTER command:
 

Sub ZMain()

  Dim Sys, Sess, MyScreen, MyArea

  Set Sys = CreateObject("PASSPORT.System")

  Set Sess = Sys.ActiveSession

  Set MyScreen = Sess.Screen

 

'The following code will copy a selected area of the screen

'on the active session. Set the screen parameters as follows:

'(StartRow,StartCol,EndRow,EndCol)

  Set MyArea = MyScreen.Area(4,3,4,26)

  MyArea.Select

  MyArea.Copy

  

'The following code will activate the next session:

  Set Sess = Sys.Sessions.JumpNext

  Set MyScreen = Sess.Screen  
 

'Select the screen area to paste into (StartRow,StartCol,EndRow,EndCol)

  MyScreen.Select 24,3,24,27

  MyScreen.Paste

  MyScreen.SendKeys("<Enter>")

End Sub

More Information

Keywords

macro, move, data, sessions, copy, paste