Login  Register

Getting "Expression Syntax Error" when dividing with a decimal point

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Getting "Expression Syntax Error" when dividing with a decimal point

Jim Winkler
I want to draw a rectangle from 0,0 to 44mm,42mm. So for the second point I enter "44/25.4,42/25.4". I get an "Expression Syntax Error". LibreCad would take a similar expression before I installed Version: v2.2.1.1 - I restarted LibreCad and Windows 11/64 and got the same error. For the second point with a rectangle and line (only tested these cases), 2.5,5 and 5/2,5 work, but  5/2.0,5 and 5/2.,5 returns the error. It seems that a decimal in the divisor causes the error. I do not get an error with the offset function, an offset of "5/25.4" produces the expected result. Should I go back to v2.2.1? Thank you -Jim
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Getting "Expression Syntax Error" when dividing with a decimal point

perepujal
As a workaround you could try with parentheses:
44/(25.4),42/(25.4)
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Getting "Expression Syntax Error" when dividing with a decimal point

Jim Winkler
That works! Thank you!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Getting "Expression Syntax Error" when dividing with a decimal point

dxli
In reply to this post by Jim Winkler
I will troubleshoot this one.

Jim Winkler wrote
I want to draw a rectangle from 0,0 to 44mm,42mm. So for the second point I enter "44/25.4,42/25.4". I get an "Expression Syntax Error". LibreCad would take a similar expression before I installed Version: v2.2.1.1 - I restarted LibreCad and Windows 11/64 and got the same error. For the second point with a rectangle and line (only tested these cases), 2.5,5 and 5/2,5 work, but  5/2.0,5 and 5/2.,5 returns the error. It seems that a decimal in the divisor causes the error. I do not get an error with the offset function, an offset of "5/25.4" produces the expected result. Should I go back to v2.2.1? Thank you -Jim
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Getting "Expression Syntax Error" when dividing with a decimal point

dxli
In reply to this post by Jim Winkler
hi Jim,

I pushed a fix for this issue in both master and 2.2.1 branch.


The root cause was due to fraction support, like "1 3/8, 2 7/16", but the support doesn't consider "3/8.1, 7/16.1" as valid fractions.

The fix: first evaluate the coordinate, only start fraction processing, if direct evaluation fails.

Jim Winkler wrote
I want to draw a rectangle from 0,0 to 44mm,42mm. So for the second point I enter "44/25.4,42/25.4". I get an "Expression Syntax Error". LibreCad would take a similar expression before I installed Version: v2.2.1.1 - I restarted LibreCad and Windows 11/64 and got the same error. For the second point with a rectangle and line (only tested these cases), 2.5,5 and 5/2,5 work, but  5/2.0,5 and 5/2.,5 returns the error. It seems that a decimal in the divisor causes the error. I do not get an error with the offset function, an offset of "5/25.4" produces the expected result. Should I go back to v2.2.1? Thank you -Jim