global constants?

Just like a Global Variable, but initialised to a value on solution startup and unmodifiable.

Any chance?

Speaking of initialising on solution startup, is it possible to run a method as part of solution initialisation (other than the obvious hack of connecting it with the solution’s startup screen)?

Thanks,
Neale.

Just like a Global Variable, but initialised to a value on solution startup and unmodifiable.

You can perfectly initialise globals at startup with a startup script.
Globals are not modifiable by users, only if the developer explicitly wants that, so why would you want an extra “constante” option that basically is already there.

Speaking of initialising on solution startup, is it possible to run a method as part of solution initialisation (other than the obvious hack of connecting it with the solution’s startup screen)?

For the time being not possible. I’ve sent this request to dev. team.

Thanks for input.

Neale:
Speaking of initialising on solution startup, is it possible to run a method as part of solution initialisation (other than the obvious hack of connecting it with the solution’s startup screen)?

It is now on the planning to have a solution startup method (which will always be connected to a form)

Cool, thanks. :=-)

But… it’d still be nice to have Global Constants. E.g. see http://forum.servoy.com/viewtopic.php?t=342

The point is not so much what users might do, but rather that something which MUST remain constant really should withstand the onslaught of whoever gets to modify the solution in future (i.e. if one of these variables gets modified, the results will be “interesting”, to say the least!).

Thanks,
Neale.

Can you give me an example where you would have a Constant Global variable?
Where do you use this global?

One example is where you have a customer table and a related addresses table. In the simplest case the relation can be made by copying the customer id to a field in the address record.

But if we now want to have separate billing and delivery addresses, both in the existing addresses table but distinguishable. So we add an addr-type field (e.g. B=billing, D=delivery). Now tha relationship is a little more involved - for the billing address we use the constant value “B” plus the id and for Delivery “D” plus the id.

The only wayI can see to do this is to use pre-initialised global variables in the relationships (one var for each relationship). This appears to work, but implies the very fundamental assumptions that the global variables (a) are always correctly initialiased and (b) never get changed. Both these assumptions should go away if the relationship used a “global constant”.

That help?

Thanks,
Neale.

Make a stored calculation: return “B”;

This will give you an constant-value too!

Yes, this seems like a valid workaround.

But I presume you meant UNstored calculation? I can’t imagine why we’d want to store that value (much less in every record!).

Thanks,
Neale.

You can’t use unstored key in a relation.

We discussed this point and are thinking of
offering literal values in relations.
(just type your key as a “text/number” instead of using a column).

maarten:
You can’t use unstored key in a relation.

Hmm… it let me do it here??? Or is there something more subtle I should check?

maarten:
We discussed this point and are thinking of
offering literal values in relations.
(just type your key as a “text/number” instead of using a column).

That’d work for me. But I’d still settle for a global constant ;-)

Thanks,
Neale.

maarten wrote:

You can’t use unstored key in a relation.

Hmm… it let me do it here??? Or is there something more subtle I should check?

You’re right Neale, (not possible on right hand side)

That’d work for me. But I’d still settle for a global constant

…both are on the wish list :)