Results 1 to 2 of 2

Thread: Equals operator overload

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Equals operator overload

    If I have this class...
    VB Code:
    1. Public Class Class 1
    2.  
    3.     dim mText as String
    4.  
    5.     Public Function ToString() As String
    6.         ToString = mText.ToUpper
    7.     End Function
    8.  
    9. End Class

    ... what do I have to do to be able to use it like this ...
    VB Code:
    1. Dim c as Class1
    2.     c = "Potato"
    3.     Debug.WriteLine(c.ToString)
    This world is not my home. I'm just passing through.

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    develop in C#. VB.net does not support operator overloading.

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