Script Problem

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jonkjon
Member
Posts: 93
Joined: Thu Jul 19, 2007 4:52 pm

Script Problem

Post by jonkjon »

Why doesn't this work...?
OpenPanel is an script device with an alpha property of Panel Name. The Panel Name property is set by a list control which does work in setting the Panel Name property to the name of a viable panel.

Dim panel

panel = getpropertyvalue ( "OpenPanel.Panel Name" )


OpenRemotePanel (panel)

If i put the name of a panel in quotes directly in the script, it works.......
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Have you tried adding a

Code: Select all

MsgBox "[" & panel & "]"
or something like that to verify that the panel name you are expecting is making it into the script?

You may also want to check the error log and see if there are any messages about it.
Scott
jonkjon
Member
Posts: 93
Joined: Thu Jul 19, 2007 4:52 pm

Post by jonkjon »

I tried the message box routine and the script is getting the correct panel name. There are no error messages in the logs either. I have found another way of doing what i need using a task but i still don't know why this script doesn't work.
jonkjon
Member
Posts: 93
Joined: Thu Jul 19, 2007 4:52 pm

Post by jonkjon »

I figured this out. When the Panel Name property gets set, there is an carriage return appended to the end of the string. If i use a string function to remove the carriage return, it works!
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Thought it might be something like that. That's why I added the brackets in my MsgBox example.

Glad you figured it out.
Scott
jonkjon
Member
Posts: 93
Joined: Thu Jul 19, 2007 4:52 pm

Post by jonkjon »

Yeah, the brackets were the giveaway. Thanks alot for the quick reply...
Post Reply