Custom constants
Hello Henk,
In the schema classes comments I describe the constants for that field. These fields are scanned and maintained in a constant table in the db. In my objects I can find these constants referenced by name and I can build lists from the constant definitions.
For a statusID integer field I have defined listProductImportStatus:Productimportstatus(listProductImportStatusNew:Nieuw,10,0;listProductImportStatusPending:Uitvoeren,20,1;listProductImportStatusDone:Afgewerkt,30,2;listProductImportStatusCancel:Geannuleerd,40,3) There is also a translation option build in.
Met vriendelijke groet,
Erik Hagemeijer
Hagemeijer Automatisering Services
Boomsluiterstraat 2
8043 AX Zwolle
T 038-4200458
F 038-4200459
E erik@hagemeijer.info <mailto:erik@hagemeijer.info>
W www.hagemeijer.info <www.hagemeijer.info/>
Op al onze aanbiedingen en overeenkomsten zijn de Algemene Voorwaarden van FENIT, gedeponeerd ter Griffie van de Arrondissementsrechtbank te Den Haag op 3 juni 2003 onder nummer 60/2003 van toepassing. Een exemplaar is te bekijken <www.hagemeijer.info/images/pdf/Algemene_Voorwaarden_HAS.pdf> als pdf via www.hagemeijer.info <www.hagemeijer.info/> en zenden wij u desgewenst kosteloos toe
> Op 6 jun. 2017, om 21:54 heeft Alex Clay <aclay@mac.com> het volgende geschreven:
>
> 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.
>
> Alex
>
>> On Jun 6, 2017, at 05:08, H.P. Noppe <henk@omnihis.nl> 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