Comparisons in Style-File

Hi, I get an "error in style, stacksize 3" with following rules in lines-file : # dont works!! highway=* & (maxheight < 3.5) {add goods=no; add delivery=no} highway=* & (maxweight < 7.5) {add goods=no; add delivery=no} Do I have to write the numbers as '3.5' or 3,5 ? Greetings, Chris

On 04/09/11 10:59, Chris66 wrote:
Hi,
I get an "error in style, stacksize 3" with following rules in lines-file :
# dont works!! highway=*& (maxheight< 3.5) {add goods=no; add delivery=no} highway=*& (maxweight< 7.5) {add goods=no; add delivery=no}
Do I have to write the numbers as '3.5' or 3,5 ?
Writing it as '3.5' would stop the error :) However non-integer numbers are not dealt with at all so it still wouldn't actually work. It should be possible to write it just the way you did so I will produce a fix. ..Steve

Hi
# dont works!! highway=*& (maxheight< 3.5) {add goods=no; add delivery=no} highway=*& (maxweight< 7.5) {add goods=no; add delivery=no}
I have a patch for this, it wasn't as involved as I expected. However (and this is probably why it wasn't done to begin with) equality is still always string based and never numeric. Eg 3.5=3.5 but 3.5 is not equal to 3.50 or anything else which has the same numeric value but different string representation. If that is important I can probably make it work. ..Steve

Am 04.09.2011 17:10, schrieb Steve Ratcliffe:
# dont works!! highway=*& (maxheight < 3.5) {add goods=no; add delivery=no} highway=*& (maxweight < 7.5) {add goods=no; add delivery=no}
I have a patch for this, it wasn't as involved as I expected.
However (and this is probably why it wasn't done to begin with) equality is still always string based and never numeric.
But '<' and '>' are always numeric based ? What happens if the value contains letters like unit-of-measure ? Are letters deleted and then the compare takes place? So: 3.5t < 4 yes abc5 < 4 no ? Chris

Hi
But '<' and'>' are always numeric based ?
Yes.
What happens if the value contains letters like unit-of-measure ?
Are letters deleted and then the compare takes place?
That right. The unit is separated out and is available to help in the comparison, but it is currently ignored and a straight numeric comparison is made. ..Steve
participants (2)
-
Chris66
-
Steve Ratcliffe