The PressAndWait method

Top  Previous  Next

The PressAndWait method acts like Press method, but it blocks the code execution waiting until the system gets unlocked.

 

VB.NET

tnxxxx.PressAndWait (aidKey as AidKey)

tnxxxx.PressAndWait (aidKey As String)

 

C#

tnxxxx.PressAndWait (AidKey aidKey);

tnxxxx.PressAndWait (string aidKey);

 

The following graphic shows the sequence of actions corresponding to the synchronous PressAndWait method:

 

Host Integration Pack TN Bridge Vb.net C# Delphi ActiveX asynchronous press and wait method

 

 VB.NET:

 Private Sub cmdLogin_Click(eventSender As object, eventArgs As System.EventArgs)

        ' this code sets userId in Field located at Row 10 Column 2

    tn3270.EditFields["R10C2"].Data = "puser"

        ' this code sets the password in Field located at Row 12 Column 2

    tn3270.EditFields["R12C2"].Data = "k2156"

        ' this code sends the ENTER Attention Identifier Key along with all modified EditFields

         tn3270.Press("Enter")

 End Sub

 

 C#:

 private void cmdLogin_Click(object eventSender, System.EventArgs eventArgs)

 {

        // this code sets userId in Field located at Row 10 Column 2

    tn3270.EditFields["R10C2"].Data = "puser";

        // this code sets the password in Field located at Row 12 Column 2

    tn3270.EditFields["R12C2"].Data = "k2156";

        // this code sends the ENTER Attention Identifier Key along with all modified EditFields

         tn3270.PressAndWait("Enter");

 }