OpenConnect - Innovations for E-Business



OpenConnect Banner

OC Visual 3270 Banner
Web-to-Host
WebConnect
OC Visual 3270
AS/400
S/390
Technology Overview
Overview Diagram
Features
Specifications
Security Levels
Web Connect FAQ's
Who Uses WebConnect
Why WebConnect
Web-To-Host Mandate
Surf3270/5250
SSO
Web Services
Gibraltar
eXtremeVista
Legacy Access Servers
SNA Access
Features
SNA Specifications
SNA Print
Print Server for CIP
OC/IPPS
Print Specifications
Print FAQ's
Enterprise Management
Management Server
Knowledge Base
Documents
Accessing Mainframe
Web-Enable Mainframe
Current Product Versions
License Center
 

Articles and Notes - EOS vs WaitForScreen

 

One of the more difficult decisions to make is when to use EOS events vs. WaitForScreen. The fundamental difference is blocking vs. speed. The WaitForScreen event is very much arbitrary, while the EOS event is fired whenever a screen is complete (typically when the keyboard is unlocked).

The best approach is always the EOS event, but for convenience sake, it is ok to use the WaitForScreen with some arbitrary waittime to accomplish your goals quickly and effectively, but remember: Production Systems should always use the EOS.

To better use the EOS, you should utilize the Visual 3270 for Windows Emulator to count the number of EOS's that actually fire. For example:



In the above example, we have recorded a script that types the word "TSO" then presses enter. Notice that there are TWO EOS events placing the cursor at position 320, and then at 80. If you were to create a screen scraper application using EOS Events you would have to count TWO EOS events and then you would be on the right screen! If you used WaitForScreen, you may be on the first EOS, start typing and then the protocol would be broken as the emulator would not know what was happening.

As always, it is best to not place all your code in the OnEOS event but rather utilize the DoEvents(VB) or ProcessMessages (Delphi) or DispatchMessage (VC, or equivalent message flushing technique). This is similar to the following code:

TNScraper.Connect

'this method works efficiently but doesn't
'check the screen contents. Developers
'shoudl consider using InStr() on the
'screen contents before moving forward.

Do
   DoEvents
Loop Until (mEOS)

'At this point we should be at the first
'screen of the University of Florida's
'mainframe. We want to type LUIS
'at the command prompt


'Lets send the screen back to the web page
S = TNScraper.getScreen
myResponse.Write S


End Sub

Public Sub TNScraper_OnEOS()
'This event is fired when a mainframe has
'sent a completed screen!
  mEOS = True
End Sub

The above code was taken from the "Articles on Creating Screen Scrapers for ActiveX." and demonstrates the proper way to handle EOS event counting. Notice you don't have to check for screen characters, cursorpositions, etc. Just count the number of screens and your done!

OpenConnect is available for training and professional services are available to get your project up and running. Call us today.

 
 
 
 
 
   
Home | Products | Services | Support | News | Partners | Customers | About Us | Demo


Copyright © 2002 OpenConnect Systems, Incorporated, 2711 LBJ Freeway Dallas, Texas 75234, USA (972) 484-5200.
Questions or comments about this web site, please email webmaster@openconnect.com.
Equal Opportunity Employer M/F/V/D.
OC://WebConnect® and eXtremeVista® are registered in the U.S. Patent and Trademark Office