"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
Go Back  Xtreme Visual Basic Talk > > > "As String' has multiple definitions with identical signatures."


Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2010, 07:10 AM
More Booze More Booze is offline
Freshman
 
Join Date: Dec 2005
Posts: 39
Default "As String' has multiple definitions with identical signatures."


I use this function:

Code:
    Public Function GetFileContents(ByVal FullPath As String, _
Optional ByRef ErrInfo As String = "") As String

        Dim strContents As String
        Dim objReader As StreamReader
        Try

            objReader = New StreamReader(FullPath)
            strContents = objReader.ReadToEnd()
            objReader.Close()
            Return strContents
        Catch Ex As Exception
            ErrInfo = Ex.Message
        End Try
    End Function

I dont really understand what the error-msg means. I've used this bit of code in many of my projects but this time I get this error:

Code:
Error	5	'Public Function GetFileContents(FullPath As String, [ByRef ErrInfo As String = ""]) As String' has multiple definitions with identical signatures.	
C:\Users\eric\Documents\Visual Studio 2008\Projects\Pick word from previous keyword to next keyword\Module1.vb	4	21	Pick word from previous keyword to next keyword
Reply With Quote
  #2  
Old 10-17-2010, 08:24 AM
Adel99 Adel99 is offline
Centurion
 
Join Date: Aug 2005
Posts: 160
Default

If I am not wrong, most likely that you are defining the function GetFileContents more than once in your code, without making them seem different to the compiler (they have the same signature).

There are some factors that contribute to the uniqueness of signatures:
  • The name of the method
  • The type(s), order and number of argument(s)

Note: the return type of a function is not part of the signature.

When two or more methods have the same signature, you will have a compile-time error.

If you want to overload a method, define it more than once, giving it the same name but different argument(s).
Reply With Quote
  #3  
Old 10-17-2010, 08:37 AM
More Booze More Booze is offline
Freshman
 
Join Date: Dec 2005
Posts: 39
Default

LOL, you're right, I already had that piece of code in the modul. I feel really stupid now. Thanks for the help!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures." "As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
 
"As String' has multiple definitions with identical signatures."
"As String' has multiple definitions with identical signatures."
 
-->