Menu

#526 Implement user-defined constants

v1.1.x
closed
None
v1.1.3
New Functionality
2021-07-14
2020-06-03
Erik Hänel
No

Implement something like user-defined constants, which can be created like this:

const NAME1=VAL1, NAME2=VAL2, NAME3=VAL3, ...

Analysis:

The actual use-case seems to have a similiar functionality as #define in C/C++. As the command define is already in use for another functionaltiy, we'll use declare as the command's name. The functionality shall provide a file-static constant to make code more readable and avoid cluttering the global variables scope with constant variable definitions. Actually, declare will act more like a search+replace macro:

declare SYMBOL1 := VALUE1, SYMBOL2 := VALUE2, ...

Because it shall be possible to move the declare command in front of the first file's procedure, this won't be installable with the current package logic. A solution might be that we extend the package logic using <file name="">...<endfile> tags for including complete files, but this will be part of another ticket.

Implementation:

  • Implementation: Implemented as proposed by the analysis.
  • Revision: [r914]
  • Implementation test: Various procedure and script files were modified and executed without deviation.

Documentation:

  • [x] ChangesLog updated
  • [x] Code changes commented
  • Documentation articles:
    • [x] corresponding documentation articles updated
    • [ ] new documentation articles created
    • [ ] not needed
  • Language files:
    • [x] corresponding language files updated
    • [ ] not needed

Tests:

New functionality was added to the automatic SW tests. Tests ran without any deviation.

Related

Commit: [r914]
Tickets: #598

Discussion

  • Erik Hänel

    Erik Hänel - 2020-11-15
    • status: open --> accepted
    • Version: Planned --> v1.1.3
     
  • Erik Hänel

    Erik Hänel - 2021-06-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,26 @@
     Implement something like user-defined constants, which can be created like this:
    
         const NAME1=VAL1, NAME2=VAL2, NAME3=VAL3, ...
    +
    +###Analysis:
    +(*Describe, what&#39;s the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you&#39;ve changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-06-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,7 +3,11 @@
         const NAME1=VAL1, NAME2=VAL2, NAME3=VAL3, ...
    
     ###Analysis:
    -(*Describe, what&#39;s the issue and which changes have to be made*)
    +The actual use-case seems to have a similiar functionality as `#define` in C/C++. As the command `define` is already in use for another functionaltiy, we&#39;ll use `declare` as the command&#39;s name. The functionality shall provide a file-static constant to make code more readable and avoid cluttering the global variables scope with constant variable definitions. Actually, `declare` will act more like a search+replace macro:
    +
    
    +    declare SYMBOL1 := VALUE1, SYMBOL2 := VALUE2, ...
    +
    +Because it shall be possible to move the `declare` command in front of the first file&#39;s procedure, this won&#39;t be installable with the current package logic. A solution might be that we extend the package logic using `&lt;file name=&#34;&#34;&gt;...&lt;endfile&gt;` tags for including complete files, but this will be part of another ticket.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you&#39;ve changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-06-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,19 +10,19 @@
     Because it shall be possible to move the `declare` command in front of the first file&#39;s procedure, this won&#39;t be installable with the current package logic. A solution might be that we extend the package logic using `&lt;file name=&#34;&#34;&gt;...&lt;endfile&gt;` tags for including complete files, but this will be part of another ticket.
    
     ###Implementation:
    -* Implementation: (*Describe, what you&#39;ve changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: Implemented as proposed by the analysis.
    +* Revision: [r914]
    +* Implementation test: Various procedure and script files were modified and executed without deviation.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
    
     * **Documentation articles:**
    -    * [ ] corresponding documentation articles updated
    +    * [x] corresponding documentation articles updated
         * [ ] new documentation articles created
         * [ ] not needed
     * **Language files:**
    -    * [ ] corresponding language files updated
    +    * [x] corresponding language files updated
         * [ ] not needed
    
     ###Tests:
    
    • status: implementing --> testing
     

    Related

    Commit: [r914]

  • Erik Hänel

    Erik Hänel - 2021-07-14
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -26,5 +26,5 @@
    
         * [ ] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +New functionality was added to the automatic SW tests. Tests ran without any deviation.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB