Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • S src
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 59
    • Issues 59
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #480

Closed
Open
Created Mar 05, 2020 by snuverink_j@snuverink_jDeveloper

`VALUE` command does not print variable names

Summary

The VALUE command does not print according to the example in the manual. The variable value is printed, but not its name.

Steps to reproduce

Run the manual example

REAL A=4;
VALUE,VALUE=TABLE(5,#*A);
REAL P1=5;
REAL P2=7;
VALUE,VALUE={P1,P2,P1*P2-3};

What is the current bug behavior?

Current output:

value:  = {0,4,8,12,16}
value:  = {5,7,32}

What is the expected correct behavior?

Ideal output (also with spaces):

value: {0*A,1*A,2*A,3*A,4*A} = {0, 4, 8, 12, 16}
value: {P1,P2,P1*P2-3} = {5, 7, 32}

Observations

After some debugging I found that this is due to the direct evaluation in the parser after which the equations that are evaluated are no longer in memory (only the variable name of the array VALUE). An definition (with :=) gives the correct output.

From the manual:

When the attribute value is a constant or an expression preceded by the delimiter = it is evaluated immediately and the result is assigned to the attribute as a constant. When the attribute value is an expression preceded by the delimiter := the expression is retained and re-evaluated whenever one of its operands changes.

For example:

VALUE,VALUE:=TABLE(5,#*A);

gives:

value: TABLE(1:5:1,(#*A)) = {4,8,12,16,20}

Note that the table output is still different from the manual output.

Possible fixes

No direct evaluation in the VALUE command, also with the = delimiter.

Assignee
Assign to
Time tracking