how can i pass a value from a procedure to actions table?
Posted: Thu Nov 27, 2014 3:09 pm
I have created a simple custom subroutine in a code module (called MyFuncs):
sub rowCount (ByRef varRowCount as Integer, myTable As ranorex.Adapter)
'Dim rowCount As Integer
varRowCount = myTable.Find(".//tr").Count()
report.Log(Ranorex.ReportLevel.Info, "User", "Table has " & varRowCount & " rows")
End sub
In my recording user code module I have inherited the code module that contains the above:
Public Partial Class Recording1
'TAM : Load our custom function library
inherits MyFuncs
Now when I go into Recording1 Actions Table, I can use the add new action button and call my user code sub.
I'm using a variable for the first parameter and passing a a web table object from the repository as the second parameter.
However, the variable from the actions table does not capture the value that should be passed back from the sub. The code definitely works as I can report out from the sub OK, but just cant pass the value back from the sub to the variable in the actions table that calls it.
Is this not possible?
here is the code created by Raborex behind the recording module Recording1:
rowCount(ValueConverter.ArgumentFromString(Of Integer)("varRowCount", varRows), repo.Forms.OutputTable)
Delay.Milliseconds(0)
Report.Log(ReportLevel.Info, "User", varRows, new RecordItemIndex(1))
sub rowCount (ByRef varRowCount as Integer, myTable As ranorex.Adapter)
'Dim rowCount As Integer
varRowCount = myTable.Find(".//tr").Count()
report.Log(Ranorex.ReportLevel.Info, "User", "Table has " & varRowCount & " rows")
End sub
In my recording user code module I have inherited the code module that contains the above:
Public Partial Class Recording1
'TAM : Load our custom function library
inherits MyFuncs
Now when I go into Recording1 Actions Table, I can use the add new action button and call my user code sub.
I'm using a variable for the first parameter and passing a a web table object from the repository as the second parameter.
However, the variable from the actions table does not capture the value that should be passed back from the sub. The code definitely works as I can report out from the sub OK, but just cant pass the value back from the sub to the variable in the actions table that calls it.
Is this not possible?
here is the code created by Raborex behind the recording module Recording1:
rowCount(ValueConverter.ArgumentFromString(Of Integer)("varRowCount", varRows), repo.Forms.OutputTable)
Delay.Milliseconds(0)
Report.Log(ReportLevel.Info, "User", varRows, new RecordItemIndex(1))