01-22-2025, 12:33 PM
|
#777
|
want to learn what I want
Posts: 1,641
Karma: 7908443
Join Date: Sep 2020
Device: none
|
Quote:
Originally Posted by chaley
For fun, here is a template that does almost the same thing but hundreds of times faster. A difference is that the formats are output in alphabetic order, not the order you specified.
Code:
program:
out = ' 💾 ';
fmts = list_sort(formats_sizes(), 0, ',') ;
for fmt_data in fmts:
fmt = sublist(fmt_data, 0, 1, ':');
size = sublist(fmt_data, 1, 2, ':');
str = if size ># 0 then strcat(fmt, ': ', human_readable(size), ' | ') else '' fi;
out=strcat(out, str)
rof;
if substr(out, -2, 0) == '| ' then
out = substr(out, 0, -3)
fi;
out
|
Whee!
Much better indeed:
|
|
|