Results 1 to 5 of 5

Thread: Syntax Problem plz Help!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    East Ballina,NSW,Australia
    Posts
    121

    Question Syntax Problem plz Help!

    Hi All,

    I've recently made an active x control that has this function in it:

    Public Function SetModemSettings(Baud As Integer, Parity As String, DataBit As Integer, StopBit As Integer)

    MSComm1.Settings = (Baud) & "," & (Parity) & "," & (DataBit) & "," & (StopBit)
    'Mscomm1.PortOpen = True

    End Function

    Ok, now the problem lies when I try to call it in my VB project...

    Mod1.SetModemSettings(cmbbaud.Text, cmbparity.Text, cmbdatabit.Text, cmbstopbit.Text)

    It thinks that this code is wrong and comes back with compile error Expected: =

    Any help would be greatly appreciated!

    Thanks.

    Best Regards,

    Smithy

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Get rid of the ()'s and it should work

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    East Ballina,NSW,Australia
    Posts
    121
    Thanks!

    Just a quick question, there's quite a few ()'s which ones should I get rid of?

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Smithy006
    Thanks!

    Just a quick question, there's quite a few ()'s which ones should I get rid of?
    VB Code:
    1. Mod1.SetModemSettings cmbbaud.Text, cmbparity.Text, cmbdatabit.Text, cmbstopbit.Text

    The line that causes the problem should look like this.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Mod1.SetModemSettings cmbbaud.Text, cmbparity.Text, cmbdatabit.Text, cmbstopbit.Text

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