Variables in array

Is it possible of using an array to hold dynamic variables of static value?

Hi,

First of all what do you mean by dynamic variables of static value?

If you mean you want to store selectors in an array and iterate through them then yes it can be done using a loop and use any actions like click, type into or get attribute whatever is required…

Regards :slight_smile:

I’m trying to put string var a and string bar b into a string array. Can I change var a and make the array value changed ?

Hi

I am still unclear as to what you exactly want… :smile:

I am sure you can change any value in an array using the index. Also if you want to change it dynamically during run time, then that’s also possible.

PS : if you want to change data type of variables then better to use arraylist which stores items as objects and you can make conversions on the fly as required.

Let me give u an example of what I wanna achieve

Assign var a = “111”
Assign Array = {var a, var b }
Assign var a = “ABC”

Writeline array(0)=“ABC”

Well,

The code works in a linear fashion; so, after your statement -

Assign var a = “ABC”

re-assigning the array again with -

Assign Array = {var a, var b }

is a mandate or else the code won’t go back and check what your assignment was previously unless you loop it.

SO the conclusion is - Yes, it is possible to get the result of “Writeline array(0)=”“ABC” only if you reassign the array -Check this out → Main.xaml (6.2 KB)

Hope this solves your query !!

Regards :slight_smile:

use Append method

array.append

1 Like

well,

He wants it replaced not appended and also, I tried arrayName.Append(TestValue) - didn’t work.

Can you possibly upload a xaml showcasing that. Thanks in advance :slight_smile:

Regards

1 Like

Hi @Raghavendraprasad

Yeah your are right. i did’t read his problem clearly …for his case he can simply use

Assign array(0) = “ABC”

if you want add one more sting in array u can use Append method
array.append(“ABC”).toarray

see example xaml
test.xaml (5.1 KB)

Thanks &Regards
Amaresan.P

1 Like

Great, thanks :slight_smile:

i figured it out, I was missing the ToArray statement - VB.net who knew? :smiley:

Anyway, thanks for your response :slight_smile:

Regards

1 Like