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

screen scrape results

Status
Not open for further replies.

rib742

Programmer
Jun 7, 2003
28
US

I have code that will connect to a mainframe host, perform specific keystrokes and maneuver through screens with a given data element (strDE). What I need to do is be able to write the resulting GetScreen data into a table. I'm able to write the given data element used to maneuver through the screens but I cannot seem to write the result of the scrape. It just comes back with a null value when the IS data on the host. Any assistance is greatly appreciated. Probably overlooking the most obvious.

The GetScreen routine has GetScreen = strRetVal.

Private Sub Command1_Click()

Dim dbs As Database, rst As Recordset

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tbl1", dbOpenTable)

PutScreen "abc", 10, 10, True
PutScreen "def", 10, 10, True
PutScreen "123", 12, 15, True
PutScreen "551", 16, 19, False
PutScreen strDE, 20, 19, True
PutScreen "X", 19, 20, True
GetScreen 9, 2, 6
With rst
.AddNew
![DataElem] = strDE
![Result] = strRetVal
.Update
End With
rst.Close

End Sub
 
Hi

if the result of GetScreen is NULL even when there is data on the screen...then doesn;t that suggest the problem is inside the GetScreen function. Might be worth posting that function as well..



Hope this helps!

Regards

BuilderSpec
 
Here's the GetScreen code:

Public Function GetScreen(X As Long, Y As Long, Length As Long) As String

Dim strRetVal As String

ocxHost.GetScreen strRetVal, X, Y, Length
GetScreen = strRetVal

End Function
 
I would start by renaming the function from GetScreen to MyGetScreen or something. It May be confusing for the object ocxHost method called getscreen. Have only seen this happen one other time depending on the scope of the ocxHost object.



Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
What, pray tell, was the fix. It is general practice here if you fix it to share with those who tried to help.
Thanks


Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
I thought I pasted but see that it didn't stick. Sorry about that.

Ended up where I forgot something on the GetScreen.

code from original post above with corrections in bold:

......
PutScreen strDE, 20, 19, True
PutScreen "X", 19, 20, True
strRetVal GetScreen(9, 2, 6)
With rst
.AddNew
......
 
In fact I guess this:
strRetVal[!] = [/!]GetScreen(9, 2, 6)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top