supid if function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CharChabil
    New Member
    • Oct 2006
    • 17

    supid if function

    how to well write the below statement :
    I got into the msgbox(ii) even the value of the called function
    [getavailableswi tch(checkStr)] is 0

    Code:
    Dim ii As Integer 
    If ii = getavailableswitch(checkStr) <> 0 Then
    MsgBox(ii)
    End If
    Note : i want the the following to be done within the same if
    1-call the function
    2-test the retrieved data from the function

    Am i thinking correctly???



    Regards
    Ramy
  • bplacker
    New Member
    • Sep 2006
    • 121

    #2
    I don't understand this

    Comment

    • CharChabil
      New Member
      • Oct 2006
      • 17

      #3
      Originally posted by bplacker
      I don't understand this
      I found that this statement goes right

      ElseIf (i = getavailableswi tch(checkStr)) And i <> 0 Then
      MsgBox(i)
      End If


      i got my respone
      thx anyway :
      but is there any other way of thinkin?

      Comment

      • bplacker
        New Member
        • Sep 2006
        • 121

        #4
        thats about right

        Comment

        • CharChabil
          New Member
          • Oct 2006
          • 17

          #5
          this is function that i m using and it returns an integer

          Code:
          Public Function getavailableswitch(ByVal checkstr As String) As Int16
          ....
          getavailableswitch = cmd.ExecuteScalar()
          end function
          what i want is: to call the above function and
          thus
          Code:
          Dim id As Integer
          If id = getavailableswitch(checkStr) <> 0 Then
          MsgBox(id)
          End If
          i know it sounds very bad,
          Note i want to do withing the "if" statement
          1-the call statement
          2-the test on retreived data from the function

          thx for your help

          Comment

          Working...