There is a way to add proper custom constants to the Omnis environment. One could write an external component that reads a text file during component registration and builds a c++ table of constants. To add constants would simply then be a matter of editing the text file, although a restart of Omnis would be required. In this way the constants would be available from the Omnis catalog and would also translate well to JS Client.
Perhaps this could be a mini project, combined with a session, at EurOmnis 2017. What do you think Mike?
Michael Monschau (Director)
Brainy Data Limited
> On 6 Jun 2017, at 20:54, Alex Clay <email@example.com> wrote:
> Hi Henk,
> Much like you we use either class variables or task variables depending on scope. I’ve often wished for a common registry of these constants in the name of clean code, but so far this approach has worked.
>> On Jun 6, 2017, at 05:08, H.P. Noppe <firstname.lastname@example.org> wrote:
>> Dear Omnis people,
>> Like the subject states I would like to talk about custom constants. There are different ways to implement this in Omnis. The way I do it is actually in two ways.
>> Use the combination of a file class for declaring the constant and a object class for initialising.
>> Declare a constant as a class variable and set the init.value of the constant.
>> Depending on how global a constant is needed I use either of the two.
>> I am curious how you all lovely developers create constants in a way which keep them maintainable.
>> Grtz Henk
>> Manage your list subscriptions at lists.omnis-dev.com
> Manage your list subscriptions at lists.omnis-dev.com
Manage your list subscriptions at lists.omnis-dev.com