Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,652 Location: Italy Was thanked: 1339 time(s) in 878 post(s)
|
Hi, another little bug, I think... note that the results are right (also for bigger scripts inside the loop) here is the file in the example: bugs%2feval_for_0.94_debug.sm.zipregards, w3b5urf3r |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/07/2010(UTC) Posts: 178 Was thanked: 19 time(s) in 13 post(s)
|
w3b,
I can't explain the error but I don't understand the eval()s. eval() is the same as "=". |
Ed |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,652 Location: Italy Was thanked: 1339 time(s) in 878 post(s)
|
Hi WizEd eval() speeds up the calculations (<10 seconds vs 20,30 seconds or minutes, if i remove all eval()s from entire script... i don't know how, but works ) regards, w3b5urf3r Edited by user 29 May 2012 10:18:45(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1127 time(s) in 723 post(s)
|
Originally Posted by: w3b5urf3r_reloaded Hi,
another little bug, I think...
Hi, I am not sure if that is a bug or a feature. My theory on eval is that it enforces immediate evaluation when used on the right hand side of assignment operations. In your example, however, there is no assignment of the eval result. eval just tries to evaluate the statements inside the line operation and as a last step tries to determine the return value of the line operation (which is normally the value of the last line). The last line, in your case, is a for statement, which is just a flow control statement and seems not to have a return value on it's own. Therefore, the last line has no return value and eval complains. I may be totally wrong, still just providing any other line at the end resolves the error message. Best regards, Martin Kraska |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,652 Location: Italy Was thanked: 1339 time(s) in 878 post(s)
|
hi mkraska, Thank you! I agree with your analysis probably the use of eval() in the left side is not conventional, however the error message is quite obscure, I think ... for the visual error I had done differently, moving the eval() inside the for loop... in addition to eliminating the red border seems to be slightly faster, although I do not understand why (hundreds of eval() instead of one...) best regards, w3b5urf3r Edited by user 30 May 2012 10:52:55(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.