dcsimg
Results 1 to 4 of 4

Thread: Assigning a variable to a class but it shows as "Nothing"?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2015
    Posts
    53

    Exclamation Assigning a variable to a class but it shows as "Nothing"?

    Hi,

    When I assign a variable to a class:

    ie. Dim myIniFile As IniFile

    and when hover over myIniFile, it displays that ATE2014.IniFile is assigned to that variable.

    However, when I compile the code, myIniFile, it displays that myIniFile is assigned to "Nothing"

    Can someone shine some light on me what the problem may be?

    Thanks

  2. #2
    Frenzied Member dolot's Avatar
    Join Date
    Nov 2007
    Location
    Music city, U.S.A.
    Posts
    1,248

    Re: Assigning a variable to a class but it shows as "Nothing"?

    You need to show us some code. Let us see how you're instantiating the class and how/where you determine if the variable is nothing.
    I always add to the reputation of those whose post are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
    My war with a browser-redirect trojan

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,888

    Re: Assigning a variable to a class but it shows as "Nothing"?

    That code doesn't assign an object to the variable, all it does is creates a variable that can hold a variable of that type. What you are seeing when you hover over the variable is the type name, you wouldn't be able to see a variable during design time, only during runtime. To create an object of that type, you'd have to use New:

    Dim myInFile as InFile = New InFile()
    My usual boring signature: Nothing

  4. #4
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Assigning a variable to a class but it shows as "Nothing"?

    Quote Originally Posted by Lalaluye View Post
    ...

    ie. Dim myIniFile As IniFile

    and when hover over myIniFile, it displays that ATE2014.IniFile is assigned to that variable.

    ...
    Not likely. It tells you that the Class IniFile is in namespace ATE2014.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width