Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing Terminal Control

Status
Not open for further replies.

lambert27407

Technical User
Jun 30, 2011
7
0
0
US
I am trying to setup a function to use in my automation programs that checks to see if you are at the login screen and will reset the terminal object on my form without having to reload the form. Am I missing somthing?

Here is my code:

Public Shared Function AtLogin(ByVal Terminal As Object)
Dim varIsAtStartScreen As String
With Terminal.Session.Screen
'System will check to make sure you are at starting screen
varIsAtStartScreen = .GetString(20, 2, 5)
If varIsAtStartScreen = "Logon" Then
'If you are at login screen returns value of "Logon" in varIsAtStartScreen
Return varIsAtStartScreen
Exit Function
Else
'If you are not at login screen it will reset the terminal control
Terminal.Session.Reset()
End If
End With
Return varIsAtStartScreen
End Function


I am referencing this Reset methond....I found this on Attachmates website

Description

Used with the Session object, Reset returns the display to its power-up operating state. Session.Reset is only valid for VT terminal sessions.
Used with the Waits collection, Reset temporarily clears the state of its wait-type objects.


Syntax

object.Reset

Element Description
Object The Session object or Waits collection

© 1996 - 2004, Attachmate Corporation. All rights reserved.
 
Just to confirm... You are using a VT session and not a 3270 or 5250?
 
I am using the 3270 session. I actually was able to get this working by using Terminal.Session.Screen.SendKeys("@C", 0) to get a clear screen the .PutString("QUIT", 1, 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top