Announcement

Collapse
No announcement yet.

Where did StringItem go ???

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

  • Where did StringItem go ???

    The HS3 - Developer Documentation still shows StringItem as a legitimate Function under Scripting/Strings, Global Variables, and Encryption/StringItem, when used in code the editor gives this error:

    Error 1 'stringItem' is not a member of 'HomeSeerAPI.IHSApplication'.
    Is this function still available in HS3?
    -Larry

    A member of "The HA Pioneer Group", MyWebSite

    Plugins:
    VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

    Hardware:
    Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

  • #2
    It looks like it was moved to the Scheduler classes:

    Dim sHs As Scheduler.hsapplication
    sHs.StringItem(mystring, 1, ",")

    I hope thats an oversight - it probably belongs in the HomeseerAPI class. You might want to enter a bug report at: www.homeseer.com/bugzilla
    HS3Pro Running on a Raspberry Pi3
    64 Z-Wave Nodes, 168 Events, 280 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

    Comment


    • #3
      It will not be included in HS3 when I asked the same question: http://board.homeseer.com/showthread.php?t=158301
      Jon

      Comment


      • #4
        Originally posted by jon00 View Post
        It will not be included in HS3 when I asked the same question: http://board.homeseer.com/showthread.php?t=158301
        ah - I think I remember seeing that post. Thanks Jon...
        HS3Pro Running on a Raspberry Pi3
        64 Z-Wave Nodes, 168 Events, 280 Devices
        UPB modules via OMNI plugin/panel
        Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
        HSTouch Clients: 3 Android, 1 Joggler

        Comment


        • #5
          You can use the .split function of the String object.
          -Rupp
          sigpic

          Comment


          • #6
            Originally posted by Rupp View Post
            You can use the .split function of the String object.
            I thought split only works with a single character separator?

            hs.stringitem (and my replacement Regex function) works with any string as the separator.
            Jon

            Comment


            • #7
              Originally posted by jon00 View Post
              I thought split only works with a single character separator?

              hs.stringitem (and my replacement Regex function) works with any string as the separator.
              Would you care to share the Replacement function?
              -Larry

              A member of "The HA Pioneer Group", MyWebSite

              Plugins:
              VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

              Hardware:
              Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

              Comment


              • #8
                Split works with chars and strings. ie 4th and 6th overloads.
                Attached Files
                -Rupp
                sigpic

                Comment


                • #9
                  Originally posted by lpitman View Post
                  Would you care to share the Replacement function?
                  Here you go:

                  PHP Code:
                      Function Stringitem(ByVal Str As StringByVal Index As IntegerByVal Sep As String) As String
                          
                  Try
                              
                  Dim Result() As String System.Text.RegularExpressions.Regex.Split(StrSystem.Text.RegularExpressions.Regex.Escape(Sep))
                              Return 
                  Result(Index 1)
                          Catch
                              Return 
                  ""
                          
                  End Try
                      
                  End Function 
                  Jon

                  Comment


                  • #10
                    Originally posted by jon00 View Post
                    Here you go:

                    PHP Code:
                        Function Stringitem(ByVal Str As StringByVal Index As IntegerByVal Sep As String) As String
                            
                    Try
                                
                    Dim Result() As String System.Text.RegularExpressions.Regex.Split(StrSystem.Text.RegularExpressions.Regex.Escape(Sep))
                                Return 
                    Result(Index 1)
                            Catch
                                Return 
                    ""
                            
                    End Try
                        
                    End Function 
                    Thank you so much Jon00
                    -Larry

                    A member of "The HA Pioneer Group", MyWebSite

                    Plugins:
                    VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

                    Hardware:
                    Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

                    Comment

                    Unconfigured PHP Module

                    Collapse

                    Working...
                    X