1 Pages (4 items)
Bug or not bug ? - Ioan - Messages
#1 Posted: 8/18/2012 9:44:30 AM
Hi everybody,
In the attached file, I have 2 situations, behaving as bugs.
Both are signalized with a big question mark commentary.
1. The function Sd is no more recognized after the beginning of a certain program segment, without being changed in any way.
2. The variable denom could be defined as in left column and is not accepted as in the right program column. In my mind both variants are the same. Of course, the 2 columns are activated only one in a time.
Thanks in advance for any help,
Ioan
NFEN1998 180812.sm (241 KiB) downloaded 30 time(s).
In the attached file, I have 2 situations, behaving as bugs.
Both are signalized with a big question mark commentary.
1. The function Sd is no more recognized after the beginning of a certain program segment, without being changed in any way.
2. The variable denom could be defined as in left column and is not accepted as in the right program column. In my mind both variants are the same. Of course, the 2 columns are activated only one in a time.
Thanks in advance for any help,
Ioan
NFEN1998 180812.sm (241 KiB) downloaded 30 time(s).
#2 Posted: 8/18/2012 10:21:12 AM
Hi Ioan 
the first is not a bug... in your loop you have redefined q and β; because your design spectrum function [MATH lang=eng]S.d[/MATH] it's not really a function (use local and global variables instead of local variables only), when you redefine q and β in the for loop the function attempts to use the new variables, but if you look the q variable defined in the loop you can see that it's not dimensionless like the behaviour factor q defined on the top of the script. Just rename q and β in both the loops to avoid causing the problem.
the second could be a bug, but you can use the eval() function to bypass the issue (see the attachments)
best regards,
w3b5urf3r


the first is not a bug... in your loop you have redefined q and β; because your design spectrum function [MATH lang=eng]S.d[/MATH] it's not really a function (use local and global variables instead of local variables only), when you redefine q and β in the for loop the function attempts to use the new variables, but if you look the q variable defined in the loop you can see that it's not dimensionless like the behaviour factor q defined on the top of the script. Just rename q and β in both the loops to avoid causing the problem.
the second could be a bug, but you can use the eval() function to bypass the issue (see the attachments)
best regards,
w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 8/18/2012 11:25:00 AM
Hi w3b5urf3r,
First of all, I send you a big thank for your useful help.
I think I must have an misunderstanding on interpreter way to deal with a problem.
In my mind, I thought that a program segment is using only the variables defined before its position as they are and that the global variables could be redefined with no restriction.
Of cause, it is more clever to avoid to redefine a global variable.
Thanks again and best regards,
Ioan
First of all, I send you a big thank for your useful help.
I think I must have an misunderstanding on interpreter way to deal with a problem.
In my mind, I thought that a program segment is using only the variables defined before its position as they are and that the global variables could be redefined with no restriction.
Of cause, it is more clever to avoid to redefine a global variable.
Thanks again and best regards,
Ioan
#4 Posted: 8/18/2012 1:31:06 PM
WroteHi w3b5urf3r,
First of all, I send you a big thank for your useful help.
You're welcome

WroteI think I must have an misunderstanding on interpreter way to deal with a problem.
In my mind, I thought that a program segment is using only the variables defined before its position as they are and that the global variables could be redefined with no restriction.
Of cause, it is more clever to avoid to redefine a global variable.
It's a shareable point of view, but this is the standard behavior for the programming languages

see wikipedia: global variables
regards,
w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 Pages (4 items)
-
New Posts
-
No New Posts