Announcement

Collapse
No announcement yet.

Have a script prob

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

    Have a script prob

    The below script is giving me a mismatch error

    sub main()
    dim host
    dim page
    dim strip_tags
    dim port
    dim Webpage
    dim data1
    dim f
    dim g
    dim fs
    dim strHTML
    dim kindex
    host="sec.noaa.gov"
    page="/rpc/costello/ace_pkp_15m.txt"
    strip_tags=true
    port=80

    strHTML = hs.GetURL(host, page, strip_tags, port)
    Webpage=replace(webpage,"|",":")
    i = InstrRev(strHTML,"2004 ")
    if i = 0 then
    strHTML = ""
    else
    strHTML = mid(strHTML,i+18)
    end if
    f= strHTML


    kindex=hs.stringItem(f,6," ")

    hs.setdevicestring "v25","Geo-magnetic Activity Estimate of " & kindex ,true
    hs.setdevicevalue "v25", kindex


    end sub

    Used to work, now I get this error
    "Type mismatch: 'hs.setdevicevalue' in line 32"
    I didn't change anything.
    Thanx
    Tim
    FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

    HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

    #2
    kindex is not a number which means your web page content is not what you expected. You can make is to the error never occurs with something like the following, but I suspect you want to look at the web page content to understand why the error occurs.

    if isNumeric(kindex) then
    hs.setdevicevalue "v25", kindex
    else
    hs.writelog "oops", kindex
    end if

    Comment


      #3
      Ok silly me
      Looking closer all I had to do was change the year in this line.
      "i = InstrRev(strHTML,"2004 ")"
      Thanx
      Tim
      FB Page - https://www.facebook.com/pages/Capt-Tim/209398425902188

      HSTouch Layouts - https://www.facebook.com/media/set/?...5902188&type=3

      Comment

      Working...
      X