Error Highlight not picking up the right 'error'

Error Highlight not picking up the right 'error' - Messages

#1 Posted: 3/7/2019 6:52:37 PM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

I am using 0.099 - build 7005

The error highlighting has worked GREAT so far, but today I ran into a case where it is highlighting the wrong equation variable. The error is actually that other variables I am citing are below the equation, but it seems that the first equation variable is getting flagged.

Error-Syntax_Hightlighting.PNG
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#2 Posted: 3/9/2019 4:27:20 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3734 posts.

Group: Super Administrator

Hello.

What error message does it show?
#3 Posted: 3/9/2019 5:55:27 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

I guess that the problem is with the if clause, and it's special evaluation method.

Clipboard01.jpg

Best regards.
Alvaro.
1 users liked this post
Andrey Ivashov 3/9/2019 5:58:00 PM
#4 Posted: 3/9/2019 5:59:11 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3734 posts.

Group: Super Administrator

Thank you very much.
Will fix it soon.

Best regards.
#5 Posted: 3/21/2019 5:00:16 AM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

I noticed something else with this- if the function is defined ABOVE a variable that it uses is defined, then the error highlight triggers.

Then, when the function is evaluated below that, the function is highlighted, and the evaluation is halted too. So the error is flagged and the evaluation of the function is stopped.

Previously, I believe that the function was not evaluated, so that it generated no error. Similarly, the function results would be evaluated after the variable definition.

This is may be a real problem for those of us who define a bunch of equations well above where they get used if the evaluation of them is done after the dependent variables are evaluated or defined.


error-highlight-1.PNG

error-highlight-2.PNG
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#6 Posted: 3/21/2019 5:55:13 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

...
Previously, I believe that the function was not evaluated, so that it generated no error. Similarly, the function results would be evaluated after the variable definition.

This is may be a real problem for those of us who define a bunch of equations well above where they get used if the evaluation of them is done after the dependent variables are evaluated or defined.



Hi sinneD. Without the actual worksheet it's hard to say, but I guess that this it's a feature of SMath (*), and you can prevent the immediate evaluation enclosing CheckIA with a line(...).

Best regards.
Alvaro.

(*) see https://en.smath.com/forum/yaf_postsm7966_Function-as-a-program.aspx#post7966 for example.
#7 Posted: 3/21/2019 9:38:17 AM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

Here is a snippet from the original file-

error-highlight.sm (12 KiB) downloaded 42 time(s).

Previously, I recall that the function would evaluate at the end no matter where the function was defined or its evaluation status. I realize that I am asking it to evaluate before all the variables are defined.


error-highlight-3.PNG

Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#8 Posted: 3/21/2019 10:44:12 AM
Arie

Arie

93 likes in 285 posts.

Group: User

Wrote


I realize that I am asking it to evaluate before all the variables are defined.



Why are you doing that? If you remove the evaluation then CheckIA_LC2 at the end evaluates just fine.

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#9 Posted: 3/21/2019 11:39:43 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. Alyles it's right. Just don't force the evaluation in the definition of CheckIA. Don't need line(...) in this case. But this because none of the variables in it's definition have a value. See the effect of line(...) in T.all (with line) and V.all (without line)

Clipboard05.gif

Best regards.
Alvaro.
#10 Posted: 3/21/2019 4:21:38 PM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

Yes, you are right, there is no reason to evaluate like this. I think I have gotten accustomed to not having the best coding habits, and the are now manifesting themselves. What I also chose to illustrate this might be misleading.

1. When I write logic/evaluations like this, Once I make the first on, I copy-paste for the additional cases I want to check right below the first instance of the equation. That way, if I had to edit the formula at a later date, all the instances would be grouped together.

In this instance, I the thing that am trying to Check Inter-Action for Load Case 2, hence the variable name CheckIA_LC2. The LC1 one was a page or two before that. LC1 and LC2 were one over the other where I first defined LC1.


2. I also usually leave them on the 'right page' that does not print because I only want the results at the end.

I moved the function definition to this part of the calc to try and figure out why the last evaluation was not working and condense the screenshot.

The major point I am trying to make is that previous versions of SMath might throw an error at the function level because the variables were not defined, but did not disable evaluation that is called after the variables have been made.



Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#11 Posted: 3/21/2019 10:57:30 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote


The major point I am trying to make is that previous versions of SMath might throw an error at the function level because the variables were not defined, but did not disable evaluation that is called after the variables have been made.



Hi. For that behavior you need the line, as in the attached: in red because can't evaluate numerically at this position in the worksheet, but give the correct result many times when it's variables have values.

Clipboard05.gif

Best regards.
Alvaro.
#12 Posted: 3/22/2019 12:59:47 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

On the other hand, besides version/version, just copying from other is generally
not the best approach. Modular stand alone pieces is better and easier to debug.
You seem to complicate matters, then complain.
Smath kernel is exceptionally powerful and convivial, long learning curve.
#13 Posted: 3/27/2019 3:10:53 PM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

Jean Giraud-

I take exception to your response, especially your statement that I am nothing more than a 'complicator' and a 'complainer'. That goes against the respectful, collaborative discourse that I have grown to expect from this community.

The calculation sheets that I am using as examples to highlight the issues I am seeing I developed many years ago, under different versions and I am re-utilizing and updating them now with the latest manufacturer information.

I believe that there is a problem with this new feature, and I am discovering it through a sequence of repetitive calculations. Those of us who are NOT the best programmers are the ones who benefit the most from this, but unfortunately the ones who are going to experience the bugs/issues more since we are the ones who make the most mistakes.

Here is another example, written from SCRATCH that again highlights an issue with the error checking. I am trying to re-write an old MathCad sheet I wrote under version 11 in SMath.

The only copying and pasting going on here is I build complicated formulas incrementally to ensure that I can back check the terms by hand before the final equation and output. You can see the progression in the worksheet.

I am mystified why the equation is halting evaluation and noting that the N.cols variable is undefined, yet I can call it above and below the statement.


https://i.imgur.com/oRWzAWy.png

PileFactorError2.PNG

PileFactorMCad.PNG

PileRedux_Factor.sm (6 KiB) downloaded 45 time(s).
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#14 Posted: 3/27/2019 3:56:55 PM
sergio

sergio

115 likes in 329 posts.

Group: User

It is not very consistent to use the same name for constants of fixed value and for the variables of a function. If you do, the evaluation of the function makes no sense except in symbolic form (as I did here).

PileRedux_Factor_ser.sm (7 KiB) downloaded 41 time(s).

sergio
1 users liked this post
Dionysios J. Pantazis 3/27/2019 6:30:00 PM
#15 Posted: 3/27/2019 4:23:28 PM
churichuro

churichuro

28 likes in 79 posts.

Group: User



this work for me.
#16 Posted: 3/27/2019 8:19:31 PM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

Sergio & churichuro-

Thank you both for your responses.

The original MathCad i wrote maybe 12-13 years ago. I am trying to update it.

The equation was defined for graphing using the series i and j.

At the end, I find the explicit value by defining the actual numbers.

I am confused by why the EXACT same code works on your end but not on mine.
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#17 Posted: 3/27/2019 8:27:24 PM
Arie

Arie

93 likes in 285 posts.

Group: User

Wrote



I am confused by why the EXACT same code works on your end but not on mine.



It's not the exact same code. Sergio uses symbolic evaluation (Ctrl + .) Same as right click clicking expression, changing optimization to symbolic.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 users liked this post
Dionysios J. Pantazis 3/27/2019 9:39:00 PM
#18 Posted: 3/27/2019 9:42:38 PM
Dionysios J. Pantazis

Dionysios J. Pantazis

16 likes in 179 posts.

Group: User

I did not think of the symbolic evaluation. Thank you.
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#19 Posted: 3/27/2019 10:09:11 PM
churichuro

churichuro

28 likes in 79 posts.

Group: User

the difference is in evaluation (=), that is after the definitions.
do this in two step and then no error is show
#20 Posted: 3/28/2019 12:55:52 AM
CBG

CBG

77 likes in 312 posts.

Group: User

This is an approach, maybe Jean or Alvaro, can Doctor it

PileRedux_Factor.png

PileRedux_Factor_CBG.sm (20 KiB) downloaded 40 time(s).



Best Regards

Carlos
  • New Posts New Posts
  • No New Posts No New Posts