Err: Too many arguments to 'Public Sub Close()'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghostrider
    New Member
    • Jan 2007
    • 34

    Err: Too many arguments to 'Public Sub Close()'

    I'm receiving an error messages that states:
    Too many arguments to 'Public Sub Close()'.
    Can someone point me in the right dircetion?


    [CODE=vbnet]Public Class HelloWorld

    Private Sub btnHello_Click( ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnHello.Click

    Dim vName As String
    vName = txtName.Text
    MsgBox("Hello World" & vName)

    End Sub

    Private Sub btnExit_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnExit.Click

    End

    End Sub

    Private Sub btnDisplay_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnDisplay.Clic k
    'Declare variables
    Dim vFile As String
    Dim vInputString As String
    Dim iInput

    'Create memory space for input file
    iInput = FreeFile()

    'Pick up the file
    vFile = "C:\Users\B lack & Gold\Documents\ School work\402 VB.zip"

    'Loop through all entries in the file
    Do Until EOF(iInput)
    LineInput("#iIn put, vInputString")
    MsgBox(vInputSt ring)

    Loop
    'Housekeeping
    Close("#iInput" )

    End Sub
    End Class[/CODE]
    Last edited by Killer42; Apr 1 '08, 01:58 AM. Reason: Added CODE=vbnet tag
  • BorlandDelphi
    Banned
    New Member
    • Mar 2008
    • 18

    #2
    I don't see nothing wrong here, if you are using VB 6, I thinks

    Comment

    • ghostrider
      New Member
      • Jan 2007
      • 34

      #3
      I'm actually using Visual Basic 2008. Everytime I go to run it I get that error message.

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Originally posted by ghostrider
        I'm actually using Visual Basic 2008. Everytime I go to run it I get that error message.
        Where is the Public Sub Close?

        Comment

        • ghostrider
          New Member
          • Jan 2007
          • 34

          #5
          Is there suppose to be one. I'm new to this?

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by ghostrider
            Is there suppose to be one. I'm new to this?
            Well, see how you've got a couple of "Public Sub" declarations in there? The error message sounds as though it's saying you have one called Close and there's a problem with the parameters.

            Or (I'm not familiar with this version, I use the much older VB6) perhaps this is about the built-in Close statement/method, and you just have the parameters wrong when you use it (in line 36).

            Comment

            Working...