Announcement

Collapse
No announcement yet.

type mismatch error with GetAuxZoneIndex

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    type mismatch error with GetAuxZoneIndex

    If I do this:

    iTemp=hs.plugin("HAI_System").GetAuxZoneIndex(8)
    msgbox hs.plugin("HAI_System").GetAuxTemp_Temp(iTemp)

    Or this:

    iTemp=hs.plugin("HAI_System").GetAuxZoneIndex("8")
    msgbox hs.plugin("HAI_System").GetAuxTemp_Temp(iTemp)

    it works fine but when I try:

    SensorNum = 8
    iTemp=hs.plugin("HAI_System").GetAuxZoneIndex(SensorNum)
    msgbox hs.plugin("HAI_System").GetAuxTemp_Temp(iTemp)

    or this

    SensorNum = "8"
    iTemp=hs.plugin("HAI_System").GetAuxZoneIndex(SensorNum)
    msgbox hs.plugin("HAI_System").GetAuxTemp_Temp(iTemp)

    I get a "Type Mismatch" error on the [iTemp=hs.plugin("HAI_System").GetAuxZoneIndex(iSensorNum)] line.
    What am i doing wrong?

    #2
    In scripts, variables are variants - that is, they are not typed specifically. The function is looking for an integer. I am not sure why SensorNum=8 did not work as it should have, but you might try one of these other approaches:

    1. SensorNum=CInt(8)

    or

    2. iTemp=hs.PlugIn("HAI_System").GetAuxZoneIndex(CInt(SensorNum ))

    See if one of those helps.
    Regards,

    Rick Tinker (a.k.a. "Tink")

    Comment


      #3
      Thanks

      That did it

      Comment

      Working...
      X