Feature or a bug? Cannot force numeric evaluation within a function - Сообщения
Thanks!

FunctionBug.sm (7 КиБ) скачан 104 раз(а).

You are using pass-by-reference, that assign a value to an input argument when it is the target of an assignment inside the procedure (see here f.e.)

the last assignment is missing; to assign the same value both to the result and to the input variable you have to define ID#:eval(ID#+1) even after the loop.
![2016-11-14 01_53_10-2016-11-14 01_52_11-SMath Studio - [FunctionBug.sm_].png - Visualizzatore foto d.png](/ru-RU/files/Download/P6g35s/2016-11-14-01_53_10-2016-11-14-01_52_11-SMath-Studio---[FunctionBug.sm_].png---Visualizzatore-foto-d.png)
WroteFeature
You are using pass-by-reference, that assign a value to an input argument when it is the target of an assignment inside the procedure (see here f.e.)
the last assignment is missing; to assign the same value both to the result and to the input variable you have to define ID#:eval(ID#+1) even after the loop.
Davide, pass by reference assignment is intentional. What i do not understand is why
The result is 56 and not 10 - I used eval() to assign a static value to ID#, or so I thought, but ID# was assigned a dynamic ID# = ID# + 1, which was not the intent.
WroteDavide, pass by reference assignment is intentional. What i do not understand is why
The result is 56 and not 10 - I used eval() to assign a static value to ID#, or so I thought, but ID# was assigned a dynamic ID# = ID# + 1, which was not the intent.
Ah! Now I see it.
WroteHey, in first block, you incremented ID by 1 in loop; in second you do it by self-incrementing i!
This is the cause

FunctionBug1.sm (6 КиБ) скачан 100 раз(а).

325 сообщений из 2 052 понравились и 1 не понравились пользователям.
Группа: Moderator
-
Новые сообщения
-
Нет новых сообщений