It can but I was reluctant to go there without taking a look first as I could not remember of my head the real structure of the list of constants returned to Omnis.
Using the standard way the external code prepares a c++ table which is passed to ECOreturnConstants, a function that is implemented in the object-library provided by the SDK which your component links with (so you cannot see that code). This function turns the c++ table into an Omnis list which is returned to the Omnis core.
I just had a quick look (my PDFDevice and the HTML example manipulates the list of constants to add a custom runtime generated constant) and the Omnis list is a simple two column list with an ID and the constant text data which includes constant names, descriptions etc. This list structure is likely never to change.
So YES we could do that as a mini-project at EurOmnis. The component can read a text file and build that list manually.
Michael Monschau (Director)
Brainy Data Limited
> On 7 Jun 2017, at 08:43, Phil (OmnisList) <firstname.lastname@example.org> wrote:
> Hi Michael,
> I was thinking that, but considered that maybe for some that is not so easy.
> Did make me wonder if the xcomp could use a text file directly, instead of resources, to return the constants list?
> Phil Potter
> Based in Chester in the UK.
> On 07/06/2017 08:08, Michael Monschau wrote:
>> Oh, forgot to mention, when adding new constants the external component would require rebuilding. So Developers would have to have access to XCode or Visual Studio Express. But it is very easy once everything is in place
>>> 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
> Manage your list subscriptions at lists.omnis-dev.com
Manage your list subscriptions at lists.omnis-dev.com