Page 1 of 1

Script Problem

Posted: Wed Aug 22, 2007 12:07 pm
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.......

Posted: Wed Aug 22, 2007 2:10 pm
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.

Posted: Wed Aug 22, 2007 2:55 pm
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.

Posted: Wed Aug 22, 2007 3:02 pm
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!

Posted: Wed Aug 22, 2007 3:04 pm
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.

Posted: Wed Aug 22, 2007 3:56 pm
by jonkjon
Yeah, the brackets were the giveaway. Thanks alot for the quick reply...