Bug or not bug ?

Bug or not bug ? - Ioan - Сообщения

#1 Опубликовано: 18.08.2012 09:44:30
Ioan

Ioan

1 сообщений из 26 понравились пользователям.

Группа: User

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 КиБ) скачан 33 раз(а).
#2 Опубликовано: 18.08.2012 10:21:12
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

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
denom.PNG
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 18.08.2012 11:25:00
Ioan

Ioan

1 сообщений из 26 понравились пользователям.

Группа: User

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
#4 Опубликовано: 18.08.2012 13:31:06
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

Hi w3b5urf3r,

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


You're welcome

Wrote

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 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
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений