Sign in to follow this  
Followers 0
sczot

Constants in array

3 posts in this topic

Hello all,

is there a way to declare an array of constants with different values for each of array element?

Výstřižek.PNG

Share this post


Link to post
Share on other sites

No, i think.

There is a workaround:
Define an array as VAR ==> CONST_LABEL1  (Uppercase indicates in programming a constant)
Define each constant as single entity at position 2,3,... in the dialog of your picture ==> CONST_LABEL_1, CONST_LABEL_2
At startup move these constants to the var.
Rule: Do never overwrite in your code anything which has all UPPERCASE. 

 

Share this post


Link to post
Share on other sites

If concern is that someone may inadvertently modify value, dont use array. Create function that has index as parameter and returns value. Index could be an onteger, enumeration, string or whatever you like.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0