Announcement

Collapse
No announcement yet.

tenScripting3 Version 3.23 Now Available

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

    tenScripting3 Version 3.23 Now Available

    See http://tenholder.net/tenWare2/tenScr...tallation.aspx for details.

    tenholde
    tenholde

    #2
    Great Product..

    tenholde,
    Thanks, much for this great development tool. I cant image HS scripting without it.

    Since I have always had trouble with upgrades; probably a factor of my advanced age, I though I would pass along my lessons learned from my recent upgrade to V3.24, so maybe help some others. Plus, good reference for me for next time I upgrade. Since I only do an upgrade every 2 or 3 years, I forget what I did last time.

    Thanks again,
    Gary

    IMAGE BELOW:

    Comment


      #3
      Thanks, I'll incorporate in next version.

      tenholde
      tenholde

      Comment


        #4
        Originally posted by Kbevo View Post
        tenholde,
        Thanks, much for this great development tool. I cant image HS scripting without it.

        Since I have always had trouble with upgrades; probably a factor of my advanced age, I though I would pass along my lessons learned from my recent upgrade to V3.24, so maybe help some others. Plus, good reference for me for next time I upgrade. Since I only do an upgrade every 2 or 3 years, I forget what I did last time.

        Thanks again,
        Gary

        IMAGE BELOW:
        I did not incorporate your Options Strict change because the warnings that are generated should encourage you to adhere to more strict coding requirements, such as not using implicit type conversions. While these may work most of the time, an implicit type cast can sometimes get you in trouble, and are very difficult to find when they occur.

        However, if most would prefer to default this option to OFF, I will make this change in future distributions.

        Thanks again for your comments. There is a new version available at http://tenholder.net/tenWare2/tenScr...tallation.aspx

        tenholde
        tenholde

        Comment


          #5
          Originally posted by tenholde View Post
          I did not incorporate your Options Strict change because the warnings that are generated should encourage you to adhere to more strict coding requirements, such as not using implicit type conversions. While these may work most of the time, an implicit type cast can sometimes get you in trouble, and are very difficult to find when they occur.
          Speaking for just myself, I agree that proper coding should be the default. I will say, that the errors generated are fatal errors and not warnings. When I saw this post, I went back into my (dozen?) modules and started working on the errors generated by the strict on. Only took about 1.5 hours but I was able to clear most of the over 200 errors generated. The exception was the module that reads VWS csv data and posts its values to HS devices:



          I am going to have to do some more research to find another way to read the text file. Suggestions/pointers welcome. I simply put an "Option Strict Off" statement in that module.

          However, if most would prefer to default this option to OFF, I will make this change in future distributions.
          I vote to leave it on.

          Thanks again for your comments. There is a new version available at http://tenholder.net/tenWare2/tenScr...tallation.aspx
          I will install the new version and see how it goes. Thanks much for your time and commitment on this. Now, in the pursuit of good internet downloading practices, if we could only get a https URL...

          Comment


            #6
            Working on the https suggestion. I've been too cheap to pay for the certificate!

            Also, when installing new release, be sure to view: https://youtu.be/SxXT6YWcoss

            tenholde
            tenholde

            Comment


              #7
              https://docs.microsoft.com/en-us/dot...a-streamreader

              Use .net StreamReader.

              tenholde
              tenholde

              Comment


                #8
                Originally posted by tenholde View Post
                Yes! Thanks much tenholde. I believe I have them all converted now. I only shot myself in the foot once. That one was a strange occurrence. I changed these two definitions:
                Code:
                        Dim strInFS As String = hs.DeviceStringByName("GDSPublicPath") & "\VWS-Data\csv\data.csv" ' File Spec to input file
                        Dim strDvFS As String = hs.DeviceStringByName("GDSPublicPath") & "\VWS-Data\schema\VWSData.csv" ' File Spec to VWS Devices file
                by making them Public and moved them to the start of my VWS module since they were referenced by a couple of functions. The Public definitions ran fine in testing under tenScripting, so I moved that script to my HS machine. When I ran the script there I got this error:
                Apr-25 1:13:42 PM Error Compiling script C:\Homeseer_HS3Pro\scripts\GDS_VWS_Data.vb: Exception has been thrown by the target of an invocation.

                And, thats all I got. No location nor any details about what the Exception was. I tried putting in a Catch statement for InnerException (System Reflection) handling but that wouldn't trap the error either. After trial and error I finally determined that for some reason the HS VB compiler did not like those statements as Public, so I moved them back to separate local definitions in both functions.

                Any idea as to why they are acceptable under tenScripting and not under HS?

                Thanks
                Gary

                Comment


                  #9
                  Could you post the beginning of the script (first 20 lines) exactly how you saved it in the HS script folder, that generated the error.

                  tenholde
                  tenholde

                  Comment


                    #10
                    Originally posted by tenholde View Post
                    Could you post the beginning of the script (first 20 lines) exactly how you saved it in the HS script folder, that generated the error.tenholde
                    See attached. When it come to HS VB coding I am pretty much old school and certainly not very sophisticated nor elegant, so if you see something I could be doing better and more in line with today's standard practices, please let me know. For example, when I use your export, it goes into a sub-directory shared by my HS machine. A text editor on that machine picks up the script and strips out (and/or rearranges) statements that may cause an error. I have been doing it that way for so long, I have forgot why it was necessary, IF in fact it is.

                    Thanks for taking a look-see.

                    Gary
                    Attached Files

                    Comment


                      #11
                      Wow! I apologize, I just found this post and realized I never responded. If I do that again, please 'bump' the posting or send me a private message/email.

                      Would you please send me the entire .vb file from tenScripting that contains the script so I can try exporting it and try and determine where HS is complaining.

                      tenholde
                      tenholde

                      Comment


                        #12
                        No problem, the error had an easy work-around. vb Module attached. Let me know what you find out.


                        Thanks
                        Gary
                        Attached Files

                        Comment


                          #13
                          The problem with the statements is not that they are Public, but I believe the issue is using HS functions in the variable definition.

                          My workaround was to remove the initial value assignment from the Public declaration, and immediately assign the value when SUB Main is invoked.

                          Do not know how/when HS creates the hs variable, but it is apparently different than tenScripting.

                          You do not have to comment out those lines when you export, you can flag them to be excluded from the Export function by including the following in a comment on the statement:

                          @DONOTEXPORT


                          ie Dim aVar as string ' @DONOTEXPORT


                          tenholde
                          tenholde

                          Comment


                            #14
                            Originally posted by tenholde View Post

                            Do not know how/when HS creates the hs variable, but it is apparently different than tenScripting.

                            Yes, I agree it is apparently different. Odd this hasn't come up before though.


                            You do not have to comment out those lines when you export, you can flag them to be excluded from the Export function by including the following in a comment on the statement:

                            @DONOTEXPORT


                            ie Dim aVar as string ' @DONOTEXPORT
                            Very good to know. Of course, this ol' brain has to remember that tip.


                            Thanks much
                            Gary

                            Comment

                            Working...
                            X