For variables which I use universally, but which would change due to reaction to data, I use a file class called Variables, which is never saved, just held in memory. (although this is a holdover from previous versions of Omnis, where variable scopes had fewer options.)
If they are truly constant, I either declare them as task variables, or use the fields defined in the Variables class above, and populate them in a method called ‘Constants’ in my startup task.
> On 06-08-2017, at 4:47 AM, Nick Renders <email@example.com> wrote:
> Hi Henk,
> We use object classes with custom properties for some constants.
> For instance: oColor.$gray would return a custom rgb() value
> rather then kGray.
> On 6 Jun 2017, at 11:08, H.P. Noppe 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