Announcement

Collapse
No announcement yet.

Event properties script parameter passing

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

    Event properties script parameter passing

    Last edited by ; April 11, 2005, 01:56 PM. Reason: Oops

    #2
    I'm not positive, but I think the second argument ('test') gets a leading space prepended.

    I've had scripts where I pass in a device name, then the script will fail because the leading space is significant (ie: ' Den Light' is different than 'Den Light')

    I've had to add a lot of 'trim's to string arguments, but I never knew why this was suddenly happening... I guess you found it!

    (I've also found that you can accidentally create a device with a trailing space as well)

    So the short answer is, yes I've seen it (lots), but never actually connected it with upgrading to 1.7.7.

    (Please, nobody recommend going to 1.7.30... My events won't fire. That upgrade lasted about 20 minutes.) 1.7.7 is the nearest thing to a working version!


    EDIT: Ok, I confirmed it. I tried a test event with 3 different args, the first like 'text.txt("main","abc")', the other two with varying amounts of space 'test.txt("main", "abc")'

    The number of spaces between the comma and the double quote is prepended to the string value passed to the script:

    Code:
     
    2005/04/11 14:08:13~!~Test Script~!~Input argument is 'abc'
    2005/04/11 14:08:25~!~Test Script~!~Input argument is '		 abc'
    2005/04/11 14:08:32~!~Test Script~!~Input argument is '									 abc'
    As a habit, I normally put one space after the comma... no wonder things were weird! I thought I was losing my mind, honestly!

    Thanks for pointing this out. I hope they fix this in HS2. In the meantime the magic word is 'TRIM'
    Last edited by firtha; April 11, 2005, 03:08 PM.

    Comment


      #3
      Thanks ...

      ... it is nice to know I'm not imagining things ...

      [mg]

      Comment

      Working...
      X