I have:
Dim some340id, some341id, someCDFid, someARCid, some8FGid etc... as String
Need to find:
Dim idtofind as String = "ARC"
something like:
Dim Found As String = some{idtofind}id
How to write code for this?
I have:
Dim some340id, some341id, someCDFid, someARCid, some8FGid etc... as String
Need to find:
Dim idtofind as String = "ARC"
something like:
Dim Found As String = some{idtofind}id
How to write code for this?
Although VB is an interpreter, I don't know if you can do this. But what you can do is use an array and index that with a meaningful Const name, for example:
Private Const i340id As Integer = 0
Private Const i341id As Integer = 1
...
Private Const iMAXid As Integer = 99
Dim some(iMAXid) As String
MsgBox "String is " & some(i341id)
@Paul, not working ("String is " empty), but i try to mod Your solution and now it's working. Much thank You.
Public Const incoming340id As Integer = 0
Public Const incoming341id As Integer = 1
Public Const incomingMAXid As Integer = 99
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim some As String = 341
MsgBox("String is " & "incoming" & some.ToString & "id")
End Sub
Now how to result change to working variable?
Dim somethingNew as String = "incoming" & some.ToString & "id"
I have somethingNew, and want to worki it like variable incoming341id
incoming341id = otherResult.Text
but now i have "somethingNew"...
Dim some As String = 341 won't work as you cannot initialize a variable in VB, only constants. See stackoverflow.com/questions/18336006/…