Results 1 to 4 of 4

Thread: A syntax question

  1. #1
    Fengling
    Guest

    Question A syntax question

    I am reading some sample code, can somebody tell me what the two : mean in the following code?

    Private Sub cboAddressList_Click()
    NewAddress = Ports(cboAddressList.ListIndex)
    If NewAddress <> Address Then
    Address = NewAddress:
    MsgBox "New Port Selected --- " + cboAddressList.Text + Chr(13) + Chr(10):
    End If
    End Sub

  2. #2
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    Nothing, really. It just tells vb that it's the end of the line. That way, you cold say:

    Code:
    If (dog = mammal) And (cat = mammal) Then
        dog = cat
        Debug.Print "Dogs are cats!"
    End If
    
    'and
    
    If (dog = mammal) And (cat = mammal) Then: dog = cat: Debug.Print "Dogs are cats!": End If
    and both would be exactly the same.

    r0ach™
    Don't forget to rate the post

  3. #3
    Fengling
    Guest

    Wink

    Thanks. rOach.

  4. #4
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    no problem.

    I think the author of the sample code is a C/C++ or Delphi coder. Delphi and C++ code ends with ;

    Dunno.

    r0ach™
    Don't forget to rate the post

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