Add contextual constants i.e. NOT_FOUND = -1 #12389
OffsetMOSFET
started this conversation in
Scripting
Replies: 1 comment 1 reply
-
You can access constants from any class. For example, if you have a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As a habit, I often create consts as a way to avoid adding comments or look at documentation. I often add a
const NOT_FOUND := -1
for a .find() orconst ANTIALIASED := true
for a .draw_circle() or other similar const to the top of my scripts or functions. It's a bit easier to parse for me, especially while glancing through code quickly.My current issue is that, without a easy way to write global constants, I will have to add these to every script, which adds it to the script's consts lists. It's a little annoying.
Beta Was this translation helpful? Give feedback.
All reactions