constant declaration

charles.rooscharles.roos Member Posts: 60
I want to declare a constant that is for programming porpouses in the meaning that it must have one value whatever language user uses.
Should i declare such variable as plain global variable then or should i declare it under Text-constant variables?

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    If it is language independant it should be a global, not a textconst.
  • krikikriki Member, Moderator Posts: 9,110
    If it is language independant it should be a global, not a textconst.
    And if that constant is used in multiple objects, best create a new codeunit "Global Constants" (or something like that), make it singleinstance, create a Function in it that returns the value:

    E.g. a function might be to return the value of Pi:

    Function Pi() : AS DECIMAL
    EXIT(3.14159265358979323846); // copied from wikipedia
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.