Announcement

Collapse
No announcement yet.

Help with asp vbscript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with asp vbscript

    Can anyone tell me were i am going wrong with this script
    PHP Code:
    <%
    dim stat
    stat
    =hs.devicestatus("^2")
    if 
    stat 2 then 
            response
    .write "front door is closed"
    ElseIf stat<>2 then
                      response
    .write "front door is open"
    %> 
    i am new to asp just trying to work out how i put my own status explinations on my web page

    cheers Supergee
    Last edited by supergee; April 13, 2005, 10:47 AM. Reason: getting script to display

    #2
    supergee,
    Try cahnging if stat = 2 then to if stat = "2" then
    and see if that works. It should be working.

    What is it printing out now?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      help with asp

      Thanks for your respnose rupp i did what you said but no change when i take the browser to the page i get the output:

      Script error:
      dim stat
      stat=hs.devicestatus("^2")
      if stat = "2" then
      Response.Send "front door is closed"
      ElseIf stat<>2 then
      Response.Send "front door is open"

      i notice that the response.write has changed to response.send any ideas

      Comment


        #4
        Doesn't
        if stat = 2
        have to be
        if stat == 2

        Comment


          #5
          Supergee,
          Try changing the response.writes to Response.Write capitalizing both letters in both cases.

          Rocco that's for javascript.
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #6
            Originally posted by rocco
            Doesn't
            if stat = 2
            have to be
            if stat == 2
            ive changed to that still showing
            Script error: if stat == "2" then
            Response.Send "front door is closed"

            what about theelse if stat<>"2" then

            Comment


              #7
              Originally posted by Rupp
              Rocco that's for javascript.
              Oops . . . sorry.

              Comment


                #8
                Originally posted by Rupp
                Supergee,
                Try changing the response.writes to Response.Write capitalizing both letters in both cases.

                Rocco that's for javascript.

                No rupp still getting script error heres the script as it is now
                PHP Code:
                <% 
                dim stat 
                stat
                =hs.devicestatus("^2"
                if 
                stat"2" then 
                Response
                .Write "front door is closed" 
                ElseIf stat<> "2" then 
                Response
                .Write "front door is open" 
                %> 
                and here is the output im getting from the browser:


                Script error:
                dim stat
                stat=hs.devicestatus("^2")
                if stat= "2" then
                Response.Send "front door is closed"
                ElseIf stat<> "2" then
                Response.Send "front door is open"

                Comment


                  #9
                  Supergee,

                  Add this to the bottom of your code:

                  end if
                  Jon

                  Comment


                    #10
                    Got it in the end

                    after much searching seems it was missing end if

                    [php]
                    <%
                    dim stat
                    stat=hs.devicestatus("^2")
                    if stat= "2" then
                    Response.Write "front door is closed"
                    ElseIf stat<> "2" then
                    Response.Write "front door is open"
                    end if
                    %>
                    [php]

                    cheers chaps

                    Comment


                      #11
                      A side comment: The elseif isn't really required. You can just use else. You already know that stat <> 2 (otherwise it wouldn't get to the else).
                      Code:
                      <%
                      dim stat
                      stat=hs.devicestatus("^2")
                      if stat= "2" then
                         Response.Write "front door is closed"
                      Else
                         Response.Write "front door is open"
                      End if
                      %>

                      Comment


                        #12
                        Originally posted by smee
                        A side comment: The elseif isn't really required. You can just use else. You already know that stat <> 2 (otherwise it wouldn't get to the else).
                        Code:
                        <%
                        dim stat
                        stat=hs.devicestatus("^2")
                        if stat= "2" then
                           Response.Write "front door is closed"
                        Else
                           Response.Write "front door is open"
                        End if
                        %>
                        Cheers smee, seems obvious now youve said thanks for the pointer

                        supergee

                        Comment


                          #13
                          Wow how embarrising ...
                          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                          Comment

                          Working...
                          X