smiler44
09-10-2011, 11:14 AM
I may have shot my self in the foot with my previous post. I realise I managed to get into another function more by luck then programming know how. I dont understand how to make functions run and can only just understand a very simple funtion but still could not write one. I need leading by the hand at the moment so would appreciate some help.
If I were to use a command button what code would I attach to it to call the following function?
The funtion gets what ever charectors are on the screen at a given
co-ordinance
Thank you in advance
smiler44
Function GetStringFromScreen(tnsscreen As Object, ypos As Integer, xpos As Integer, length As Integer) As String
' Get a string from screen object given xpos, ypos & length
' If Session Disconnected, (TNS crash) raise error.
On Error GoTo GetStringFromScreen_ERH
If tnsscreen.Parent.Connected = True Then
GetStringFromScreen = tnsscreen.GetString(ypos, xpos, length)
End If
Exit Function
GetStringFromScreen_ERH:
Err.Raise numSESSIONDISCONNECTED, Title, strSESSIONDISCONNECTED
Exit Function
End Function
If I were to use a command button what code would I attach to it to call the following function?
The funtion gets what ever charectors are on the screen at a given
co-ordinance
Thank you in advance
smiler44
Function GetStringFromScreen(tnsscreen As Object, ypos As Integer, xpos As Integer, length As Integer) As String
' Get a string from screen object given xpos, ypos & length
' If Session Disconnected, (TNS crash) raise error.
On Error GoTo GetStringFromScreen_ERH
If tnsscreen.Parent.Connected = True Then
GetStringFromScreen = tnsscreen.GetString(ypos, xpos, length)
End If
Exit Function
GetStringFromScreen_ERH:
Err.Raise numSESSIONDISCONNECTED, Title, strSESSIONDISCONNECTED
Exit Function
End Function