CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Aug 2007
    Location
    Wales UK
    Posts
    59

    [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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured