首页 > 解决方案 > What is the name of Python's "vars()" function in vb.net?

问题描述

I have this simple piece of code:

##Variables representing a table of 5 rows and 5 columns:

r1c1, r1c2, r1c3, r1c4, r1c5 = "","","","",""
r2c1, r2c2, r2c3... = "","","","",""
#for all 5 rows. (I know this is not the best way to do things, but bare with me)
for r in range(1,6):
    for c in range(1,6):
        currentPos= "r"+str(r)+"c"+str(c)
        vars()[currentPos]="identified"
        #print(currentPos)
print(r1c1)
print(r1c2)
print(r...)

All of these variables actually represent a number of objects in my vb.net program, whose .text property I want to alter to a value.

In essence, I don't know what the vb version of the python "var()" function is, if there is any at all.

Further detail: I actually want all the fields and rows from a database to correspond to each positioned textbox in my vb program.

Alternative solutions are also okay.

标签: pythonvb.netfunction

解决方案


推荐阅读