Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
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
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Hi Ioan the first is not a bug... in your loop you have redefined q and β; because your design spectrum function S.d 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 Edited by user 18 August 2012 18:07:24(UTC)
| Reason: Not specified File Attachment(s): Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
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
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: Ioan Hi w3b5urf3r,
First of all, I send you a big thank for your useful help. You're welcome Originally Posted by: Ioan 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.
It's a shareable point of view, but this is the standard behavior for the programming languages see wikipedia: global variablesregards, w3b5urf3r |
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.