PASSPORT Knowledge Base
Macros

Date Published: September 23, 2004
Date Updated: March 7, 2008

Title

Edit-Copy and Edit-Paste in Macros

Product

PASSPORT PC to Host, PASSPORT Web to Host

Emulation Types

TN3270, TN5250, VT, SCO ANSI, Wyse 60

Issue

In previous versions of PASSPORT I was able to use the SendHostKeys command in a macro to send Edit-Copy and Edit-Paste to the host screen. Since I upgraded to version 2004, these no longer work. How can I resolve this?

Solution

SendHostKeys is no longer supported for sending Edit-Copy or Edit-Paste, since these are menu commands rather than host keys. However, the PASSPORT Object interface may be utilized to issue these commands.

Example

Below is a sample PASSPORT macro that copies the currently selected text, moves the cursor, then pastes the text to the new location:

 

Sub ZMain

    Set Sys = CreateObject("PASSPORT.System")

'selects the currently active session

    Set Sess = Sys.ActiveSession

'selects the screen object

    Set MyScreen = Sess.Screen

'selects the area (Start Row, End Row, Start Column, End Column)

    Set MyArea = MyScreen.Area(1, 1, 1, 24)

MyArea.Select     

    MyScreen.Copy

'modify the row and column below to move cursor to another location

    MyScreen.MoveTo 24, 7

    MyScreen.Paste

End Sub

More Information

Keywords

macro, edit, copy, paste