How to pass variables as reference from recording to UserCode?

Best practices, code snippets for common functionality, examples, and guidelines.
mrt
Posts: 219
Joined: Mon Mar 16, 2020 11:31 am

How to pass variables as reference from recording to UserCode?

Post by mrt » Tue May 04, 2021 12:11 pm

Dear folks,

I was wondering if it is possible in the meantime to pass a variable by reference into user code?
Currently I have to select the same variable twice (once as parameter, once as return value) which seems unnecessary and I want to get rid of it, byRef would be the solution.

I found this rather old post from 2012 where it was not possible:
https://ranorex.com/forum/pass-a-parame ... 10048.html

Is it possible in the meantime?

As soon as I define a parameter byref in UserCode method, the method does not show up anymore when selecting from recording module.
Is there some trick to do, or is this Ranorex's way to say: "not supported" ?

thanks
BR mrt

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7465
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to pass variables as reference from recording to UserCode?

Post by odklizec » Tue May 04, 2021 12:20 pm

Hi,

Well, I'm afraid, there is no change regarding this matter. Ranorex methods still support only these basic types:
Arguments.png
ByRef variables are not supported yet.
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

mrt
Posts: 219
Joined: Mon Mar 16, 2020 11:31 am

Re: How to pass variables as reference from recording to UserCode?

Post by mrt » Tue May 04, 2021 12:28 pm

alright, thanks anyway for the quick reply! :)

br mrt