VoxCommando
Поддержка русского языка => Поддержка русского языка => Topic started by: John Smith on November 21, 2020, 11:43:03 AM
-
Есть ли возможность создать в VC одномерный массив переменных без использования Python?
-
Not exactly but you can achieve something similar either by using the action Results.SetVar
https://voxcommando.com/mediawiki/index.php?title=Actions#SetVar
Or by using map tables.
https://voxcommando.com/mediawiki/index.php?title=Maps
The best choice will depend on how you want to use the values.
-
Yes, I often use «SetVar» and «Maps», but they only allow me to create individual variables, and I need an array, whose elements can be accessed through an index.
For example:
value = [10, 20, 30, 40, 50, 60]
a = value[0]
b = value[1]
Probably, this can only be implemented through global variables in Python.
-
You can still use single variables as an array like this:
value1=10
value2=20
value3=30
value4=50.
Or if you are only interested in numbers you can store them in a single vairable separated by commas.
value = 10,20,30,40,50
Or you can use maps tables.
But then again, I can't think of any reason why you would not want to use Python.
As I said, it will really depend on how you want to use them. We don't know enough about what you are trying to do, for us to be able to offer a full solution.
-
If you want to use map tables. You can think of the map table as the array, and the key as the index of the array.
If you want to set the 3rd index of an array using a map, like: MyArray[3]=30
Map.Set MyArray 3 30
and later you can retrieve it.
Map.Get MyArray 3