Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7060 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

hello all,

the title says it all. Is there anyway to disable the use of a button by using a script.

thx

Posted

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}

Posted

Or even simpler and IMHO cleaner...

If [ not yourtest ]

{remainder of script steps}

End If

Posted

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.

Posted

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

Posted

Actually, we have no idea how long the script is. So it is up to gug to determine which one fits more appropriately. :D

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.