Jump to content

String used as variable


Ccssrs69

Recommended Posts

Ok I know that it can be done in javascript by using eval() but I can't seemed to find what I'm looking for in VB.Net, any help is greatly appreciated, Thanks.For i As Integer = 1 To 10

If Not sUserDefined_ & i Is Nothing Then

sb.Append("<COL_" & i & ">" & sUserDefined_ & i & "</COL_" & i & ">")

End If

NextThe sUserDefined_1 through 10 is passed in from a dll and then passed out through XML. In javascript this is accomplished as the following. for(x=1;x<10;x++){

if(eval("sUserDefined_" + x)){

//Build String

}

}Thanks in advance.

Link to comment
Share on other sites

Why don't you make sUserDefined an array instead? Then you don't have to eval at all, which is very costly.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...