Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • 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
OPAL 2.4.0
Milestone
OPAL 2.4.0 (Past due)
Assign milestone
Time tracking