View Single Post
Old 01-22-2025, 12:33 PM   #777
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,641
Karma: 7908443
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post

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:

Click image for larger version

Name:	MWSnap 2025-01-22, 14_32_07.png
Views:	244
Size:	6.3 KB
ID:	213227

Click image for larger version

Name:	MWSnap 2025-01-22, 14_31_54.png
Views:	249
Size:	4.5 KB
ID:	213228

Comfy.n is offline   Reply With Quote