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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting data from a terminal screen 1

Status
Not open for further replies.

brc2000

Technical User
Jan 3, 2001
2
US
Hi
I am trying to capture data off a terminal screen and save it to a file without saving the entire screen. We are filling out an online form that is transmitted to a mainframe. I would like to write a script that would get the value of about 5 fields on the form and write them to a file. the trick is..how do you identify the location of the of the field to aspect. I have seen emulation programs that would recognize screen coordinates e.g. MyVar=(row5,col1-row5,col21). Any ideas would be appreciated.
 
Look in the Help file Aspect Script Reference under "Termgets" to see how to read a string variable from terminal.

You can use a consistent string variable on the form to determine the locations to collect data. For example, if I want to display a name, and I have a form that looks like this:

"Name: (User Fills in Name - Max 25 Characters)"

I would write:

Code:
Proc Main
String LINETOREAD, LINETOFIND
Integer ROW, FIELDPOSITION
for ROW = 0 upto 24
  termgets ROW 0 LINETOREAD 79
  If strfind LINETOREAD "Name:" FIELDPOSITION
    FIELDPOSITION = FIELDPOSITION + 5
    Substr LINETOFIND LINETOREAD FIELDPOSITION 25 
    Usermsg "The name is %s" LINETOREAD ;Displays name
  Endif
endfor
EndProc
Robert Harris
Communications Advantage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top