In the IDE you can create constants.
And if you create them as string constants you can set them to be “localized” or not.
This gives you the ability to support multiple different languages in a single build as the localized language files will be saved and used by your application.
But what happens to other kinds of constants if you add different instance values to ? What does the IDE do with those ? And how does it use those ?
Create a new desktop project. Add a new number constant, kWindowMin. Then add set a new instance value for MacOS ANY LANGUAGE and make the value 500. Add another instance for Windows ANY LANGUAGE and make the value 700.
Set the Window1 Width to #kWindowMin
And notice what it does on macOS (or Windows) immediately. Then run it on macOS and Windows.
Note that this is NOT a value looked up at runtime. It’s not determined at runtime like a dynamic language constant is. With a dynamic constant you can change the system language, run and if there is a localization for that language it will show that localization. Stop the app, switch languages and run again and the new language should show.
This kind of constant is looked up in a platform specific way at COMPILE / BUILD time.
Its set AT COMPILE TIME and never again.
They can be handy because in some situations you need a larger window or field size because the default localized values for a language are longer (German tends to be this way compared to English)
And since you can use it for all kinds of values including integers yiu could use it for colors and have a different set of colors you use for macOS or Windows quite easily.
And you can use Booleans. So with settings for transparency its fairly easy to set up one value for macOS to be TRUE – since it supports transparency very nicely – and FALSE for Windows. Then you can assign that constant to those Windows & controls TRANSPARENT property and easily switch between macOS having transparency on and Windows having it off.