gug Posted July 27, 2005 Posted July 27, 2005 hello all, the title says it all. Is there anyway to disable the use of a button by using a script. thx
-Queue- Posted July 27, 2005 Posted July 27, 2005 Make the first script step Exit Script or Halt Script. If you want to conditionally disable it, use If [yourTest] Exit Script End If {remainder of script steps}
Vaughan Posted July 28, 2005 Posted July 28, 2005 Or even simpler and IMHO cleaner... If [ not yourtest ] {remainder of script steps} End If
-Queue- Posted July 28, 2005 Posted July 28, 2005 True, but I try to avoid having too many steps within Ifs, especially if there are several nested Ifs within the remainder of steps. I think it makes it cleaner to keep the remainder steps out of the overall If to make it clearer. This may be a holdover on my part from version 5, which doesn't have the Else If step and does that whole indenting off the screen deal when you have a large number of nested Ifs. Not to mention how difficult it can be to line up Ifs with their related End Ifs.
PeterHW Posted July 28, 2005 Posted July 28, 2005 There is something to be said for both approaches, especially with longer scripts with more nested if's I would use the "If(true) exit" approach for clarity, while for shorter scripts the "If(untrue) [script] EndIf form" is more elegant. But for a short script such as this it hardly matters. Peter
-Queue- Posted July 28, 2005 Posted July 28, 2005 Actually, we have no idea how long the script is. So it is up to gug to determine which one fits more appropriately. :D
Recommended Posts
This topic is 7060 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now