Announcement

Collapse
No announcement yet.

End of statement Expected

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

  • #31
    For the record, I didn't recommend any changes in that thread, someone else did But that may (partially) explain it, if you're using vbc rather than the 'standard' vbnc.

    I've found that with vbc, you can't embed an hs.xxx call within another hs.xxx call like you can with vbnc. Strangely, the call seems to work, but it throws an error and the remainder of the script doesn't get run. To remedy, try replacing your Set_Level sub with this:

    Code:
    '--------------
    Sub Set_Level (theDevice, devLevel)
        hs.WriteLogEx("Set_Level", "starting", "#ff00ff")
        Dim cc As Object
        Select Case devLevel
            Case 0
                cc = hs.CAPIGetSingleControl(theDevice,false,"Off",false,false)
            Case 1 To 99
                cc = hs.CAPIGetSingleControl(theDevice,false,devLevel,false,true)
            Case 100
                cc = hs.CAPIGetSingleControl(theDevice,false,"On",false,false)
            Case 255
                cc = hs.CAPIGetSingleControl(theDevice,false,"On",false,false)
        End Select
        hs.CAPIControlHandler(cc)
        hs.WriteLogEx("Set_Level", "finished", "#ff00ff")
    End Sub
    See how the hs.CAPIGetSingleControl is no longer embedded within the hs.CAPIControlHandler call.

    I can't get the parms(0) to work with either compiler, but we'll have to agree to disagree on that!

    Comment


    • #32
      That did it!
      Thanks a lot.

      Comment

      Working...
      X