I've spent hours on this. :frustration: After I finally figured out that, for some un-Godly reason, %track% and %_total% return tracknumbers in different formats, I'm still running into problems. Basically, I want this loop to sort by album, and increment a counter variable everytime it finds a complete album, this telling me how many complete albums I have in any folder.
Here's my code (carriage returns are entered in for readability):
List compiled by %_app%
Updated:'['COLOR="Blue"']'%_date%'['/COLOR']'
$puts(no_albums,0)
$loop(%album%)
$if($eql($left(%track%,2),%_total%),$puts(no_albums,$add(1,$get(no_albums))),)
$loopend()
Added:
'['COLOR="Blue"']''['SIZE="5"']'MUSIC'['/COLOR']' - '['COLOR="Red"']'$get(no_albums) Albums'['/COLOR']' and change
For some reason, it outputs zero, even though when change $puts to $put it returns numbers other than zero. Even this is weird. I was testing it on an folder with 2 albums and a single track in it. The count it should have returned while looping was 1, 2. It returned 1, 2, 6. I have NO idea where that 6 is coming from, especially since no_albums can only be increased by one and that output occurs EVERYTIME that function is called.
So, not only is the function being magically called a 3rd time, it's also being increased magically by 4. Can anyone help?!? Argghghg.