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

Multple <tab>

Status
Not open for further replies.

Inovate

Technical User
Oct 24, 2006
15
US
Is there a way to tab in Sessions multiplyed by a counter for example if the counter is 3 then I want to <tab> 3 times but I do not want to write the code as myscreen.sendkeys"<tab><tab><tab>". Any suggestions?
 
Your interested in the red bits
Code:
[COLOR=red]Declare Function MultiTab (NumberOfTabs As Integer) As String[/color]

Sub Main

    Dim sys as object
    Dim sess as object
    Dim myscreen as object

    Set MyScreen = CreateObject("EXTRA.System").ActiveSession.Screen
[COLOR=red]    MyScreen.Sendkeys MultiTab(5)[/color]

End Sub
[COLOR=red]
Function MultiTab(NumberOfTabs As Integer) As String
    For AllTabs = 0 to NumberOfTabs - 1
        sTabString = sTabString & "<tab>"
    Next
    MultiTab = sTabString
End Function[/color]

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
You'd be so much better off with:
sess0.screen.moveto (X,Y)
or
sess0.screen.putstring "My Text",X,Y

These functions won't incur the lag time of updating the screen showing the cursor at each tab.

calculus
 
You'd be so much better off with:
sess0.screen.moveto (X,Y)
or
sess0.screen.putstring "My Text",X,Y
assuming x and y don't change

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
If you know it's always 3 tabs, it's unlikely the x,y would change. However, you can also use the Search Method for those occasions that you want to change position.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top