Create list of variables with no hardcode (VEX, Python?... )
1644
4
2
-
- AlbertoGZ
- Member
- 34 posts
- Joined: Jan. 2017
- Offline
How to create a list of variables, as well attributes, like myVar1, myVar2, myVar3, etc, with no hardcode?
What I find:
//Variables:
string myVar1 = "text1";
string myVar2 = "text2";
string myVar3 = "text3";
//...
//Attributes:
s@myAttrib1 = myVar1;
s@myAttrib2 = myVar2;
s@myAttrib3 = myVar3;
//...
What I tried:
int i = 0;
for (i=0; i<5; i++);
string myVar+itoa(i) = "text+"itoa(i);
s@myAttrib+itoa(i) = myVar+itoa(i);
It seems only works for string value, and not at time variable/attrib creation.
Thanks!
Edited by AlbertoGZ - Oct. 15, 2022 07:44:06
-
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
-
- dedeks2999
- Member
- 85 posts
- Joined: May 2011
- Offline
int i = 0;
for (i=0; i<5; i++)
{
setpointattrib(0, "my_var_" + itoa(i), @ptnum, itoa(i), "set");
}
— dedeks 3000 —