Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Ioan  
#1 Posted : 18 August 2012 16:44:30(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

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
File Attachment(s):
NFEN1998 180812.sm (242kb) downloaded 14 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 18 August 2012 17:21:12(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hi Ioan Good


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):
NFEN1998%20180812_debug.sm (242kb) downloaded 17 time(s).
Davide Carpi attached the following image(s):
qbeta.PNG
denom.PNG
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Ioan  
#3 Posted : 18 August 2012 18:25:00(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

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
Offline Davide Carpi  
#4 Posted : 18 August 2012 20:31:06(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Ioan Go to Quoted Post
Hi w3b5urf3r,

First of all, I send you a big thank for your useful help.

You're welcome Good

Originally Posted by: Ioan Go to Quoted Post
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 Good

see wikipedia: global variables


regards,

w3b5urf3r
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Users browsing this topic
Guest
Similar Topics
[attachment missing] Bug or not bug ? help me (Bugs & Problems)
by alexx 08/03/2020 16:15:04(UTC)
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.