Designer Scripting Annoyance

Am I the only one that always collapses this? Any way for IA to change this so the designer remembers the last selection? Maybe set it to closed by default? I think I click this hundreds of times a day!

image

Maybe. I always leave it open, since my general practice is to make event scripts single line calls to a project script function.

2 Likes

Really?
Why is that...? Any benefits?

To help keep your code as DRY as possible. Localizing business logic into functions helps keeps your project organized and makes being able to call that business logic from a gui component/tag event/scheduled event etc very easy to implement.

This has the added benefit of then really being able to use github and version control over your code. If your business logic is on a Vision GUI component though, you can’t really do it for instance.

Since I’m still largely using Vision, having all the code in script modules keeps me from having to dig around in Vision’s window and template editors to fix things.

For gateway events, it is to avoid the legacy scoping rules.

I also tend to optimize many events by caching information in script top-level dictionaries or similar objects. This is much simpler if the code that uses the cache is in the same place.

But mostly, it is to set myself up to not repeat myself.

1 Like