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
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
Code:
[FONT=Calibri][SIZE=3]Function GetStringFromScreen(tnsscreen As Object, ypos As Integer, xpos As Integer, length As Integer) As String[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]' Get a string from screen object given xpos, ypos & length[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]' If Session Disconnected, (TNS crash) raise error.[/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT][FONT=Calibri][SIZE=3]On Error GoTo GetStringFromScreen_ERH[/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT][FONT=Calibri][SIZE=3]If tnsscreen.Parent.Connected = True Then[/SIZE][/FONT]
[SIZE=3][FONT=Calibri] GetStringFromScreen = tnsscreen.GetString(ypos, xpos, length)[/FONT][/SIZE]
[FONT=Calibri][SIZE=3]End If[/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT][FONT=Calibri][SIZE=3]Exit Function[/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT][FONT=Calibri][SIZE=3]GetStringFromScreen_ERH:[/SIZE][/FONT]
[SIZE=3][FONT=Calibri] Err.Raise numSESSIONDISCONNECTED, Title, strSESSIONDISCONNECTED[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Exit Function[/FONT][/SIZE]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT][FONT=Calibri][SIZE=3]End Function[/SIZE][/FONT]