Export, $Puts() is executed always


#1

I found out put() and puts() statements are executed even the execution flow does not pass from that point.
A very simple code.

$put(myvar,'a')
$if($eql(1,2),$puts(myvar,'bcdef'),'1 = 2')
$get(myvar)
Output of this code is
a
1 <> 2
bcdef

Variable myvar is set to 'bcdef' even $puts() is not meant to be called because of $if condition (1==2).
Very disappointing...
Is this behavior since the beginning of mp3Tag?


#2

My experience is, that the functions $put/$puts cannot be used as an argument within an expression.
I use the function $put/$puts always at the top most level.

For example (this is a different algorithm than yours, just to show the principle) ...
$put(myvar,'a')
$puts(myvar,$if($eql(1,2),'bcdef','1 <> 2'))
$get(myvar)

See also ...
/t/3727/1
Check if field value is identical for all selected tracks

DD.20121104.1800.CET


Unexpected If-Then Behavior in an Export Loop
In einer Aktion die Größe eines Verzeichnis ermitteln?
#3

I understand your point. Do you think someone can confirm how mp3tag was designed to use $put/$puts statements?


#4

Yes, I assume there is one, who is able to do so.

DD.20121104.1828.CET