Page 1 of 1

Databindung as Array?

Posted: Fri Oct 25, 2019 10:12 am
by endercraft
Hello,

I'm actually new to the ranorex software and not pretty good in english, so I'm sorry!

I want to make a Data-Sourced Array-Variable, where I can use the Array-Variable arrName[0] = Excel Input A2 or arrName[1] = Excel Input A3. My Goal is it to say, that the arrName has in the column B / C / D / ... the entry 1 or nothing.

If (the arrName[x] has a 1 in the column X)
make this
else
make this



Is something like that possible, and if, how?


Screenshot of an Example-Database (this coult also change his row-/column-coun)
Image

Have a nice day!

Re: Databindung as Array?

Posted: Mon Oct 28, 2019 9:00 am
by odklizec
Hi,

I'm afraid, I don't quite understand, what exactly you want to achieve? Anyway, there is currently no built-in support for arrays in data connector columns. Data connectors work exactly as they are described in User Guide. One column=one value, which can be assigned to one or multiple variables. And each row = one iteration. That's currently all.

If you want to have one column, holding multiple values (aka array), then yes, you can do that. But for the connected variable, it will still look like one value (e.g. "val1;val2;val3") and then, you have to parse the "array" in code or recording module with connected variable, using user code you write.

Re: Databindung as Array?

Posted: Mon Oct 28, 2019 2:30 pm
by endercraft
Hey,

I actually want to use the data source in my code, but I don't know how.

If ranorex already seperates the data it's perfect!

But how can I say
var Example1 = value(row1 , column1)
?

I'm sorry, but I am using ranorex just 2 weeks now and I'm not pretty good in english :D

Re: Databindung as Array?

Posted: Tue Oct 29, 2019 8:55 am
by odklizec
Hi,

You can read data from Excel file, by using data connector code, described here:
https://www.ranorex.com/forum/viewtopic ... 699#p11699

And this post can help you with splitting a coma delimited string into array:
https://www.ranorex.com/forum/viewtopic ... 632#p24687