Announcement

Collapse
No announcement yet.

Immediate Script Syntax Problem

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

    #16
    VB Script is a dead language. MS no longer supports. The difference between VB Script and VB.net in homeseer is minimal. Here is a vb script from help manual

    Sub Main()
    Dim DevRef
    DevRef = hs.GetDeviceRefByName("Living Room Light")
    if hs.ison(DevRef) then
    hs.Speak "The living room light is currently on."
    end if
    End Sub

    Here is a vb.net script from the help manual

    Sub Main(parms As Object)
    Dim DevRef As Integer
    DevRef = hs.GetDeviceRefByName("Living Room Light")
    If hs.IsOn(DevRef) then
    hs.Speak("The living room light is currently on.")
    End If
    End Sub

    Parameters are always passed in vb.net with no paramaters giving a null.

    There is so little difference between vbscript and vb.net in homeseer that going with the supported vb.net seems logical in my mind.

    Not pushing you in any direction just setting out pro's / con's for you to think about.

    Comment


      #17
      Originally posted by AllHailJ View Post
      VB Script is a dead language. MS no longer supports. The difference between VB Script and VB.net in homeseer is minimal. Here is a vb script from help manual

      Sub Main()
      Dim DevRef
      DevRef = hs.GetDeviceRefByName("Living Room Light")
      if hs.ison(DevRef) then
      hs.Speak "The living room light is currently on."
      end if
      End Sub

      Here is a vb.net script from the help manual

      Sub Main(parms As Object)
      Dim DevRef As Integer
      DevRef = hs.GetDeviceRefByName("Living Room Light")
      If hs.IsOn(DevRef) then
      hs.Speak("The living room light is currently on.")
      End If
      End Sub

      Parameters are always passed in vb.net with no paramaters giving a null.

      There is so little difference between vbscript and vb.net in homeseer that going with the supported vb.net seems logical in my mind.

      Not pushing you in any direction just setting out pro's / con's for you to think about.
      Well, always passing parameters, whether they exist or not, seems inefficient. Yes, I can see for consistency, but I'd rather not have to worry whether I've closed every parentheses, or whether my code is a sub or a function.

      And I like not having to define my variable types in advance. I can see where that might cause problems in higher-end applications, and in portability, but for this type of small-scale stuff, I think it's more efficient. I'm looking to not have to spend hours debugging my code.

      Thanks for the refresher.


      Jim Speiser
      38-year veteran of Home Automation
      Still don't know squat

      Comment


        #18
        Originally posted by Uncle Michael View Post
        I'd also suggest taking a look at tenScripting.
        Ah! Just checked that out, and.....ah! We like the looks of that. Because if anyone needs help keeping his code up to snuff.....Thank you for the pointer.


        Jim Speiser
        38-year veteran of Home Automation
        Still don't know squat

        Comment

        Working...
        X