g_sures Posted September 14, 2010 Report Share Posted September 14, 2010 Hi all, Is it possible to get default value of a control during runtime? Thanks, Suresh Kumar.G Quote Link to comment
crossrulz Posted September 14, 2010 Report Share Posted September 14, 2010 (edited) It looks like Default Value is a scripting property (at least as of 8.6). So in the development environment, the answer would be yes. No so in an application. A work around may be to save your current value, invoke the Reinitialize to Default (use an invoke node), grab the new value (the default), and then set the value back to your original saved value. Hopefully somebody smarter than I has a better idea than that. Edited September 14, 2010 by crossrulz Quote Link to comment
jcarmody Posted September 14, 2010 Report Share Posted September 14, 2010 A work around may be to save your current value, invoke the Reinitialize to Default (use an invoke node), grab the new value (the default), and then set the value back to your original saved value. Like this: Quote Link to comment
Yair Posted September 14, 2010 Report Share Posted September 14, 2010 It looks like Default Value is a scripting property (at least as of 8.6). So in the development environment, the answer would be yes. No so in an application. I'm assuming it's a private property, not a scripting property, since it doesn't involve the code. It's quite possible that it does work in an executable. There's no particularly good reason for it not to work. Quote Link to comment
jcarmody Posted September 15, 2010 Report Share Posted September 15, 2010 I'm assuming it's a private property, not a scripting property, The node is blue. Doesn't that mean that it's scripting? Quote Link to comment
Yair Posted September 15, 2010 Report Share Posted September 15, 2010 The node is blue. Doesn't that mean that it's scripting? I believe it does. If memory serves, blue is scripting, brown is private and red is deprecated. In any case, even if a property is marked as a scripting property, I don't think it automatically means it won't work in an EXE. Obviously, it won't work if it needs the diagram, because the RTE doesn't know how to read the diagram, but it will probably work for something like this. In any case, the only way to know for sure is to test it, although I wouldn't suggest this to Kumar. Kumar, what are you actually trying to achieve? P.S. You can also see the details of each property in the context help or detailed help for it. Quote Link to comment
jcarmody Posted September 15, 2010 Report Share Posted September 15, 2010 (edited) In any case, the only way to know for sure is to test it I tested it. It worked in an executable. Edited September 15, 2010 by jcarmody Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.