Page 2 of 2

Re: Removal of ByRef when creating using code causes a problem

Posted: Wed Sep 05, 2018 3:47 pm
by KJG
Ah - I found the problem.

I was mapping the actual variable in my recording e.g.
UserCode SetVarTo() $MyVar NewValue

Whereas this sub actually takes the name, not the variable - I should have read this more carefully. So this works ...
UserCode SetVarTo() MyVar NewValue

Yippee! Thanks for all your help. This will hopefully make my upgrade somewhat easier now.

Regards.

Re: Removal of ByRef when creating using code causes a problem

Posted: Wed Oct 03, 2018 12:31 pm
by KJG
thanks for your help.
I think I have this working now by putting the code into a user code collection. I can then access this from where I need it.
This still means I have to find all the references to my existing usercode but that is just a bit of a repetitive but simple job.

So I am still confused why the initial calls

SetValue( variablename, newValue ) based upon
Sub SetValue(Byref variable, newVal)

changed in the Ranorex generated code after upgrade to
variable = SetValue(newValue)
Function SetValue(newValue) as variant

or similar.

Anyway, I think I have my answer now.

I do wonder if this is an ability which could be made available anyway in recordings. Say, SetVariable Variable Value.
Another useful one would be ConcatVariable.
This would save any delving into code at all, and still allow the generic elements to be used.

Thanks for your patience.

Re: Removal of ByRef when creating using code causes a problem

Posted: Thu Oct 04, 2018 11:40 am
by RobinHood42
Hi,

I'm glad that I could help. For improvements and feature requests, please use the UserVoice.

Cheers,
Robin