Я искал в Интернете, чтобы узнать, как динамически объявлять имена переменных автоматически, и я пришел без результатов. мой подход к коду я упрощающий выглядят следующим образом:alturnitives для динамического объявления имен переменных автоматически в vb.net
dim choice1 as string
dim choice2 as string
dim choice3 as string
...
я желаю я могу Approch это следующим образом
dim count as integer
while count is 1 to 10
count +=1
end while
dim (choice+count) as string
' it suppose to create variable choice with the addition to the name from 1 to 10 like choice1, choice2, choice3 and so on.
вы можете помочь мне.
пс: я также пытался создать объявленные переменные в массиве таким образом:
dim count as integer
Dim var As Array = {Dim choice1 as string, dim choice2 as string}
while count is 1 to 10
var.add(dim choice+count as string)
end while