vb.net - Set string values inside for without knowing names -


i trying find correct way set string values inside without knowing actual numbers. here's trying possible in vb6 not sure using vb.net

public class form1  dim itest1 string dim itest2 string dim itest3 string  private sub button1_click(sender object, e eventargs) handles button1.click      = 1 3          "itest" & = "aaa" &      next      debug.print("itest1:" & itest1)     debug.print("itest2:" & itest2)     debug.print("itest3:" & itest3)  end sub end class 

try using arrays instead.

dim itest(3) string  = 1 3         itest(i) = "aaa" &  next 

or this

dim variables new dictionary(of string, string)()          = 1 3          variables("itest" + i.tostring) = "aaa" &      next      console.writeline("itest1:" + variables("itest1"))     console.writeline("itest2:" + variables("itest2"))     console.writeline("itest3:" + variables("itest3")) 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -