[RESOLVED] VB2008 - How do I declare an object with a dynamically assigned name?
Hi All,
I have just taken the leap from VB6 to VB2008 and am not finding it too bad but I have now come across a scenario which has got me stumped:
I am trying to declare an object with the name dynamically assigned from the contents of the string as per the example below:
Code:
Public Shared Function Launch_Session(ByVal Session_Path As String, ByVal Session_File As String) As Boolean
Dim Session_File.Value As Object
' Do other things here
End Function
I am not even sure if this is possible but I need some way of using the same code to generate multiple objects based on the parameters sent to the function. I need to do this to use each of the objects created independently.
Any idea on how to get this working or an alternative solution?
Thanks,
Gareth.
Last edited by GarethD.Norris; August 16th, 2008 at 04:23 AM.
Current Language: Visual Basic .NET 2008 / .NET v3.5
Previous Language: Visual Basic 6.0