Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - FerryH

Pages: [1]
Bugs and Issues / mathematics comparison not working in code template
« on: November 12, 2016, 04:49:49 am »

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.

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

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...

Pages: [1]