Have a QScript to share, or need help with programming? Post your comment here.
-
sbank
- Posts: 174
- Joined: Tue Jul 21, 2015 9:35 pm
-
Contact:
Post
by sbank » Sat Jun 10, 2017 2:15 pm
Hi,
I have noticed that since 2.29 (not sure if it was present slightly beforehand), but when I compile known working qscripts, I get various errors complaining about the math.
It seems that when a -1 is involved in the calculation, that seems to trigger the error:
ERROR: Illegal math expression. (Line2)
The following simple code demonstrates the problem:
Code: Select all
a1 = exp( -1 * 1.41 * 3.14 / 13 ) ;
c3 = -1 * a1 * a1;
Changing c3 to just be '-a1 + a1' also triggers the problem.
-
earik
- Site Admin
- Posts: 474
- Joined: Mon Dec 01, 2014 12:41 pm
-
Contact:
Post
by earik » Sat Jun 10, 2017 4:20 pm
Hi sbank,
Someone else just had a similar issue with -1's. I'm not sure what would be different from the older versions, but will take a look. In the meantime, you can get around it like this:
old way:
c3 = -1 * a1 * a1;
new way:
c3 = (-1) * a1 * a1;
So basically, just put the -1 in parenthesis, and it should be fine.
Earik
-
earik
- Site Admin
- Posts: 474
- Joined: Mon Dec 01, 2014 12:41 pm
-
Contact:
Post
by earik » Wed Jun 14, 2017 6:42 pm
Following up on this issue - it has been fixed in 2.31. Turns out it had to do with a weird linker issue in the C++ compiler that is used to build W59. I had replaced the linker with a new one, and some strangeness ensued with some of the really old modules (like the QScript Editor) and the way some of the functions had been written. It was actually a relatively easy fix, which is a nice change from the linker errors I've come across in the past, which usually leave me pulling my hair out and threatening the computer with violence...
Anyway, I'll get the fix out soon - hopefully by next week.
Regards,
Earik
Users browsing this forum: No registered users and 17 guests