Author Topic: mathematics comparison not working in code template  (Read 1054 times)

FerryH

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
mathematics comparison not working in code template
« on: November 12, 2016, 04:49:49 am »
Hi,

I am in the process of writing a new Code generation, and try to align the code nicely.
To get the job done I add a bunch of whitespace and trim the variable.
Now that works nicely, but als trims codelines bigger than the offset.

$b=%LENGTH($a)%
%if $b < "50"%
$a+="                                                                  "
$a=%LEFT($a, 50)%
%endIf%

I tried a sorts of notations, but the result is always the same. The generated code shows the line %if 27 < "50"%. When adding "" to the variable it will result in %if "27" < "50"%
But if I change the line to %if $b == "50"% then the if result is as expected.

The documentation states: Note that if you are using one of the mathematics comparison operators, <test> must be a decimal number in string format.

And indeed %if $b < 50% doe not work as well. Even tried %if "$b.0" < "50.0"%
None of the standard code templates have a if with mathematics comparison, so I could not find a working sample.

Is this a bug, or just me not getting the notation?
Functionally I would like to place the comments in column 50.

Thank you for any help...