user defined variables


#1

Hi

I'm trying to do smth like an avergage bitrate over a catalog. I tried looping all the mp3s and adding their bitrates to one variable, but if I want to display the result after the loop, the variable is empty? :frowning: How to accomplish this task?
How to globalize the variable?

Next, I want to display certain information if the bitrate is VBR and other info if it's CBR. The question is, how to check if it's CBR or VBR?

Thanks in advance
rmg


#2

My html_dano_01_ex_mp3tag config has an average bitrate calculation.
/t/1495/1

%_vbr%


Export Question - VBR Folders...
#3

Oh, thx for the average bitrate calculator. It works.

%_vbr% prints CBR or VBR for mp3, but how to make a conditional sentence for checking it. Like $if(%_vbr%==CBR,then,else)<-this one doesn't work.


#4

$if($eql(%_vbr%,CBR),then,else) I think.
See the help file for more information.


#5

Ok, now I can check the CBR/VBR status, but a new problem occured :frowning:

I loop through the mp3 file sizes and measure their length. What I'd want to do is to get the longest length in a variable, but somehow it doesn't seem to work.

The code I use:
$loop(%_filename_ext%)$iflonger(%_file_size%,$get(length),$puts(length,$len(%_file_size%)),)$loopend()get(length)

The results are 7,7,7,7,7,7,7,8,7,7, but the variable somehow remembers the 7 and not the 8, at least when I try to use it outside the loop. Please tell me what am I missing here?


#6

Try:
$loop(%_filename_ext%)$puts(length,$iflonger(%_file_size%,$get(length),$len(%_file_size%),$get(length)))$loopend()
$get(length)

This should be ok.


#7

Thanks, this piece of code works.
But still, what is the big difference between these two codes?


#8

I leave that to Florian to explain :stuck_out_tongue:
It has some thing to do with the order of the code evaluation but I can't really explain it.