Results 1 to 7 of 7

Thread: Help with lua strings

  1. #1
    Join Date
    Dec 2003
    Location
    Winnipeg, Canada
    Posts
    119

    Default Help with lua strings

    I just want to pass a variable to a function... it should be easy but I need a hand.

    Here is what I want to do...

    h=6
    d=1
    x = serial.translateescapesequences("/04/"..h..d)
    cm11.SendBinary(x)
    x = serial.translateescapesequences("/07/"..h.."7/0"..d.."/16/31")
    cm11.SendBinary(x)

    But that doesnt work?

    help!?
    Rob

  2. #2
    Join Date
    Mar 2005
    Location
    Hutchinson, Kansas, USA
    Posts
    203

    Default

    Does it work if you build the resultant strings outside the function call? Like
    Code:
    h=6 
    d=1 
    x = "/04/"..h..d
    x = serial.translateescapesequences(x) 
    cm11.SendBinary(x) 
    x = "/07/"..h.."7/0"..d.."/16/31"
    x = serial.translateescapesequences(x) 
    cm11.SendBinary(x)
    ??

  3. #3
    Join Date
    Dec 2003
    Location
    Winnipeg, Canada
    Posts
    119

    Default

    That was my first try but it didnt work either.

  4. #4
    Join Date
    Mar 2005
    Location
    Hutchinson, Kansas, USA
    Posts
    203

    Default

    I can't test the serial.translateescapesequences or cm11.SendBinary function calls themselves, but if they're expecting strings, there's no reason why your code shouldn't work (or mine), 'cuz that's definitely what we're sending...

    Sorry I was no help, deferring to someone smarter than I (shouldn't take long)... :wink:

    Terry

  5. #5
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    When you say it doesn't work, just what do you mean?

    That the X10 commands don't work?

    What happens if you try printing the strings? Do they look okay?
    --Rob

  6. #6
    Join Date
    Dec 2003
    Location
    Winnipeg, Canada
    Posts
    119

    Default

    The strings look fine when i put them up on the OSD but the X10 command doesnt work. It does work when I enter it as a string tho .. so the command itself works.

  7. #7
    Join Date
    Dec 2003
    Location
    Winnipeg, Canada
    Posts
    119

    Default

    I must have hung the x10 plugin in my experiments. I rebooted and it works now! thx guys.

    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •