Results 1 to 1 of 1
  1. #1
    slaner is offline
    Join Date
    2013 Dec
    Thanked 0 Times in 0 Posts
    Rep Power

    Is that possible to use structure type as reference type?!?!

    First of all, answer is 'YES'.

    Well, basically structure type cannot be used by reference type.
    Which means, structure type cannot be Nothing(null).

    Reference Type: Classes, Interfaces, ...
    Value Type(Non reference type): Enum, Structure, ...

    I don't know completely list of reference type and value type.

    BTW, implementation is this:

    [Public | Dim | Private] NameOfVariable As [NonReferencedType]?

    for example:
    Dim intNullable As Int32?
    -> Internally data type of this code will change like this:
    -> Dim intNullable As System.Nullable(Of Int32)

    And using '?' to suffix, you can also use 'Is Nothing' or 'IsNot Nothing' statement.
    This is very useful when you calling API.

    complete example:
    Function GetNullableStructure() As Int32
        Return Nothing
    End Function
    This code's result will false. Cause 'Int32' is structure type and not referenced.

    Function GetNullableStructure() As Int32?
        Return Nothing
    End Function
    This code's result will true. Cause 'Int32' is structure type but 'System.Nullable(Of T)' makes structure type as reference type.

    sorry for my bad english and expression
    I hope this post will helpful to you guys

Similar Threads

  1. The Coolest Battle Type Class I’ve Ever Seen
    By tmtptk in forum General Talk
    Replies: 0
    Last Post: 2014-10-30, 08:22 AM
  2. [Guide] World Mysteries / Rubi / Class Type skills
    By Miloks in forum Allods Online
    Replies: 0
    Last Post: 2013-06-11, 08:17 PM
  3. SF Game Type Work with any Version
    By -A-Viruz™ in forum D3D Programming
    Replies: 1
    Last Post: 2012-12-19, 08:48 AM
  4. [Help] what is a complex type in aika?
    By vincent2 in forum Aika Guides, Tutorials
    Replies: 0
    Last Post: 2012-02-21, 05:04 AM
  5. Type of Monster
    By darkenigma08 in forum Requiem Guides, Tutorials
    Replies: 0
    Last Post: 2011-01-14, 01:02 AM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

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