PM58631: RPE: Wrong Variables' Calculation in RPE

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as user error.

Error description

  • Customer reports that the plus Operator '+' doesn't work
    properly in RPE 1.1.2. If the user tries to add two internal
    variables, the value is calculated wrong.
    
    I have attached the template and spec he sent. However the steps
    to reproduce are:
    
    1) create two internal variables with default values. Lets say
    100 and 200 respectively.
    2) create a template to add the two variables, var1+var2 and
    generate the report.
    3) We would observe that instead of printing 300, it prints
    100200.
    
    Observations:
    
    If I initialize the variables in the script expression, for
    example,
    
    var1=100
    var2=200
    sum=var1+var2
    
    Now we get 300. However, as mentioned, by using the default
    values, the addition is not working.
    

Local fix

Problem summary

Problem conclusion

Temporary fix

Comments

  • Reviewed and find out this works as designed.
    
    In RPE, all variables doesn't have a type, so we don't know
    about the input type (ie. string, int, double, etc). This is
    by design. So when you do the double value variable
    addition, you have to multiply the variables by 1.0 to make
    it a double.
    
    For example, variable A default value 100, variable B
    default value 200. If you want to add them, you have to use
    this: A*1.0+B*1.0. If you only use '+', it is considered as
    string addition.
    
    Why this doesn't happen to '-' or other operators? Because
    other operations could not be used on string, but only '+'.
    

APAR Information

  • APAR number

    PM58631

  • Reported component name

    TLOGIC PUBL ENG

  • Reported component ID

    5724V98PE

  • Reported release

    112

  • Status

    CLOSED USE

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-02-21

  • Closed date

    2012-05-15

  • Last modified date

    2012-05-15

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

Applicable component levels



Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Publishing Engine

Software version:

1.1.2

Reference #:

PM58631

Modified date:

2012-05-15

Translate my page

Machine Translation

Content navigation