July 27, 200520 yr hello all, the title says it all. Is there anyway to disable the use of a button by using a script. thx
July 27, 200520 yr 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}
July 28, 200520 yr Or even simpler and IMHO cleaner... If [ not yourtest ] {remainder of script steps} End If
July 28, 200520 yr 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.
July 28, 200520 yr 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
July 28, 200520 yr Actually, we have no idea how long the script is. So it is up to gug to determine which one fits more appropriately. :D
Create an account or sign in to comment