Results 1 to 6 of 6

Thread: If ---- IS Not ""-----"

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Belfast
    Posts
    109

    If ---- IS Not ""-----"

    Hi can anyone help me out with this line? I don't know what I'm doing wrong. It's for vb.net.

    If strProductName Is Not "EOF" Then

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    er... I havn't done much .NET but I gues you are trying to compare 2 strings????

    SO:

    If strProductName <> "EOF" Then

    would seem a bit more appropriate.
    Leather Face is comin...


    MCSD

  3. #3
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Post Guessing...

    Originally posted by steekyjim
    Hi can anyone help me out with this line? I don't know what I'm doing wrong. It's for vb.net.

    If strProductName Is Not "EOF" Then

    Thanks
    I dont have VBNET... *BUT*

    I dont know if that would help, but what you are doing is comparing 2 string values and if the two string values are not identical, then *something happens*...

    I asume that the productname has to be different from the string "EOF"...

    I would use the following line in VB6... (OR EVEN QUICK BASIC )

    VB Code:
    1. If strProductName <> "EOF" Then

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  4. #4
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Talking DAMMIT

    GOTA WRITE FASTER NEX TIME!
    Grrrr

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  5. #5
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Just beet you to it!
    Leather Face is comin...


    MCSD

  6. #6
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    You could also use the Equals method on String

    If s.Equals("EOF") Then
    MessageBox.Show("same")
    Else
    MessageBox.Show("different")
    End If

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