Hi!
I'm trying to export some data to a simple text file and have some trouble now.
I wannt to have some text alignment. I'm using $puts() to set some variables for additional calculaition.
A variable updated by $put() has an old value inside a sub-loop!
Well, there may be a simple solution but... here it is...
The difference is inside the $loop(%track%) loop at variable 'tw'.
$filename(txt)$loop(%_folderpath%,1)$loop(%artist%,1)%artist%
$repeat(-,$len(%artist%))
$loop(%album%)$loop(%title%)$puts(tw,$ifgreater($len(%title%),$get(tw),$len(%title%),$get(tw)))$loopend()
$puts(tlw,$add($get(tw),14))$puts(aw,$add(18,$add($len(%album%),$add($len(%_total_time%),$len(%_total_files%)))))
$puts(aw,$ifgreater($get(tlw),$get(aw),$get(tlw),$get(aw)))
$puts(tw,$ifgreater($get(aw),$get(tlw),$add($get(tw),$sub($get(aw),$get(tlw))),$get(tw)))
%album% - Tracks: %_total_files% Time: %_total_time%
$repeat(-,$get(aw))$loop(%track%)
$num(%track%,2). %title%$repeat( ,$sub($get(tw),$len(%title%))) - %_length%$loopend()
$loopend()$puts(tw,0)$puts(aw,0)$puts(tlw,0)
$loopend()$loopend()
Between, the variable is updated outside the loop in the line:
...
$puts(tw,$ifgreater($get(aw),$get(tlw),$add($get(tw),$sub($get(aw),$get(tlw))),$get(tw)))
...
I don't know what to do now. Is there a logical error on my script?
I would appreciate any help!