i am trying to write a script in qtp like this
Public Function sayhi
msgbox "hi"
end
Dim level0
dim count1
count1 = DataTable.GetSheet("Action1").GetRowCount
msgBox count1
For counterVariable = 1 to count1
functionname = DataTable.value("methodnames","Action1")
call functionname
DataTable.GetSheet("Action1").SetCurrentRow(counterVariable)
Next
assume functionname is going to have a value say "sayhi". Can i use that value to call the function ? like i did in the code "call functionname".
I know it is not working but how to do such call ?
The execute method can do this
will call sayhi if its in the datatable.
Use GetRef() to get a 'pointer'/reference to a Sub or Function:
output:
Someone mentioned there was no Include in VBS but you can code one with...
My source : http://cyreath.blogspot.com/2014/02/vbscript-call-function-in-another-file.html