I have some older scripts from version 6 of Ranorex.
I have a repository item -
GenericListItem listitem[@text=$generallistvalue]
In my recordings I could call user code as follows: -
Usercode SetVariableTo() $generallistvale MyNewValue
The user code was defined as
Public Sub SetVariableTo(ByRef Variable As String, NewValue As String)
'
' Purpose:
' This sub will set the value of a variable passed in.
'
' Parameters:
' Variable The Variable to be set.
' NewValue The value to be assigned.
'
' Notes:
' This can be used to set Ranorex repository item variables and can avoid having to have
' many items in the repository.
'
' EXAMPLE
' To set the $MyItem variable value to "Execute"
' SetVariableTo( MyItem, "Execute")
'
' NOTE This may not work as a direct call but is usually used from the recording module where
' Variable should be set to the (green) variable and the new value entered as the NewValue parameter
'
'
Variable = NewValue
End Sub
And this used to work.
Now I have upgraded to Ranorex 7.1 and there are innumerable compilation errors referring to this sub. I discovered this is because I am using ByRef (which is a perfectly acceptable VB.NET clause).
If I take out the byref, the sub will compile but no longer do what I need it to do - change the value of the variable being passed in.
I no longer use this style of user code as I have split my recordings into much much smaller blocks and have a module which accepts the parameter and selects the correct list item, but it will take a long time to do this to this upgraded code.
Why has ByRef been removed since it is valid VB.NET and has been working? I really don't understand why this has been done. This simple removal is causing me pain on this project and I have several other projects using this style of code which I am updating.

Is there a quick way within my sub to use the same parameters to do what I need to do? If I can change the sub it will save having to change a lot of other scripts.
Regards,
Kevin