Announcement

Collapse
No announcement yet.

Variable not declared

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

    Variable not declared

    Sub Main(parms as object)
    Dim DeviceStringCode AsString
    DeviceStringCode = hs.DeviceStringByName("HAI Security")
    hs.WriteLog ("Test",DeviceStringCode)
    End Sub
    I get the following errors when running the script. I have tried the script with and wihtout the room as part of the argument.
    I also trife hs.DeviceString(169) with th edevice's reference number with the same results.

    Jan-19 4:14:12 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\DeviceString.vb: 'DeviceStringCode' is not declared. It may be inaccessible due to its protection level.

    Jan-19 4:14:12 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\DeviceString.vb: 'DeviceStringCode' is not declared. It may be inaccessible due to its protection level.

    Jan-19 4:14:12 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\DeviceString.vb: End of statement expected.

    Jan-19 4:14:12 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\DeviceString.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    #2
    You need a space between the "As String" on the second line.
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Variable not declared

      Thanks much, i never noticed no space, problem solved

      Comment

      Working...
      X