i404
13 years agoContributor
how to use variable in an object?
Hi Guy,
Is there a way I can use a variable in object action?
Say if I do:
Sub Main ()
call browse_to("Reports")
call browse_to("Database")
End Sub
Sub browse_to(section)
Dim topnav
topnav = page.Top.Section.Buttons.Menu
' in namemapping, it is suppose to be topnav.Reports, so topnav.Reports.Click() will work
' in namemapping, it is suppose to be topnav.Databse, so topnav.Database.Click() will work
' how can I use variable in this context?
topnav.top_section.Click()
End Sub
Any clue guys?
TIA,
Regards
Ian
Is there a way I can use a variable in object action?
Say if I do:
Sub Main ()
call browse_to("Reports")
call browse_to("Database")
End Sub
Sub browse_to(section)
Dim topnav
topnav = page.Top.Section.Buttons.Menu
' in namemapping, it is suppose to be topnav.Reports, so topnav.Reports.Click() will work
' in namemapping, it is suppose to be topnav.Databse, so topnav.Database.Click() will work
' how can I use variable in this context?
topnav.top_section.Click()
End Sub
Any clue guys?
TIA,
Regards
Ian