Results 1 to 16 of 16

Thread: Newbie Question, Please Answer

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99
    How do you do "is NOT equal to"?

    if blah != blah then
    blah
    end if


    ??????
    ___________________________
    Chris

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Not equal = <>

    A <> B
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    equal to
    == or =
    not equal to
    <> or ><
    greater
    >
    greater or equal
    >=
    less
    <
    less or equal
    <=

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    yeah, it is <>

    or you could do

    Code:
    If Not myNum1 = myNum2 Then

  5. #5
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Originally posted by Edneeis
    equal to
    == or =
    You're thinking of C++

    VB only supports =

    It uses it as both an assignment operator and a truth operator.

    Just clearing that up.
    Courgettes.

  6. #6
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    Even:

    Code:
    If Not (Blah = Blah) then
        blah
    End If

    r0ach™
    Don't forget to rate the post

  7. #7
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    ok, I think we might be confusing some people now!

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by V(ery) Basic
    VB only supports =

    It uses it as both an assignment operator and a truth operator.
    Actually (to be ridiculously precise) VB lacks an assignment operator.
    VB assigns values with the Let keyword accompanied with the equal sign.
    Code:
    Let x = 5
    But since the early days of BASIC the Let keyword kan be omitted. So we usually just type:
    Code:
    x = 5
    But that doesn't make the equal sign an assignment operator.
    Because of VB's lack of an assignment operator assignments can only be done in the beginning of a statement and not in the middle.

  9. #9
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    The Let statement is medieval.
    Try also using:
    Code:
      If (variable) Then ... Else ...
      'instead of:
      If (variable <> 0) Then ... Else ...
    This boolean notation uses less code and executes faster.

  10. #10
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    [quote]
    The Let statement is medieval.
    Try also using:

    code:-------------------------------------------------------------------------------- If (variable) Then ... Else ...
    'instead of:
    If (variable <> 0) Then ... Else ...
    --------------------------------------------------------------------------------
    This boolean notation uses less code and executes faster.
    [\quote]

    the boolean would only show true, and could not be used for comparison?

  11. #11
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Yes, unfortunately, no comparison. But you can use this notation also when using the result from a Function as the boolean test.

    If (Do_The_Test()) Then ...

  12. #12
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    yeah, but he was asking for the function of not equal to,
    not true or false!

  13. #13
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    All right silvy, I was just mentioning this by increasing my replies. I want to be a guru too, you know?

  14. #14
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    yeah i know, but did you know, John (the administrator) has to make you a guru, based on your ability to post good helpful posts!

  15. #15
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Is John's job vacant?

  16. #16
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    bad luck i don't think so

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