Results 1 to 8 of 8

Thread: [RESOLVED] Syntax Error

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    16

    Resolved [RESOLVED] Syntax Error

    For an application I was writing I require the ComboBox to display the open COM Ports for the user to select and therefore I wrote...

    For Each CommCtrl.Commport ()
    cmbPort.Items.Add(CommCtrl.CommID)
    Next

    However I seem to be getting a syntax error after the CommPort().
    Firstly, is this the right sort of code to use? and if it is how can I remove the syntax error from this section?

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Syntax Error

    Go to the online help in Visual Studio and paste this link into the URL line:

    ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vbalr/html/ebce3120-95c3-42b1-b70b-fa7da40c75e2.htm

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    16

    Re: Syntax Error

    Thanks for the help... but the website/page doesn't open. 'The Page Cannot Be Displayed'.
    Anything else I could do?

  4. #4
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Syntax Error

    You need to paste that link into the online help page within Visual Studio.
    Open Visual Studio, Click On Help.
    Paste it in the URL line on the help page

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    16

    Re: Syntax Error

    Yea, I did that...I get the error page, lyk the one you get in internet explorer.

    (It's attached)
    Attached Images Attached Images  

  6. #6
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Syntax Error

    After you paste it in. Remove the http:// and put back in the ":" after
    "ms-help" It shouldn't read like this:

    http://ms-help//MS.VSCC.v80/MS.MSDN....7da40c75e2.htm

    It should read like this:

    ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vbalr/html/ebce3120-95c3-42b1-b70b-fa7da40c75e2.htm

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Syntax Error

    Just look up "for each" in the MSDN library. It will show you what the correct syntax is.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2007
    Posts
    16

    Re: Syntax Error

    Got it, the code was wrong. Thanks anyways

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