--[[ @title !sortiX.lua @chdk_version 1.4 @subtitle :...;....1....;....2....;....3....;....4.. @param s min #zeile | 0=Environment @default s 0 @range s -1 128 @param o >|< @default o 0 @range o 0 1 @param D neg. default ignored --> @default D -1 ]]-- function fsort(s,sfil) local lin,x,X,abs={},0,0,s if s<0 then abs=-s end if s==0 then for var,ee in pairs(_G) do x=x+1 if o==1 then lin[x]=(var.." "..tostring(ee)) else lin[x]=var end end else for ee in io.lines(sfil) do if abs<#ee then if s~=0 or ee~=lin[x] then x=x+1; lin[x]=ee end end end end table.sort(lin); X=x if s<0 then repeat print(lin[x]); x=x-1 until x<=0 else repeat print(lin[X-x]); x=x-1 until x<=0 end lin=nil return X end --- : set_console_layout(0,0,50,14) if t==1000 then sfil,s,o=...; s=s or 0; o=o or 0 end if io.type(sfil)~="file" then sfil=file_browser("A/CHDK/LOGS/") end if sfil==nil then sfil="A/CHDK/LOGS/LOG_9999.txt" end if sfil~="A/CHDK/LOGS/LOG_0123.txt" then print_screen(0123) else print_screen(0124) end collectgarbage() print("--- < ",collectgarbage("count")) print("--- < ",sfil,-fsort(s or 0,sfil),collectgarbage("count")) collectgarbage() print("--- < ",collectgarbage("count")) print_screen(0) set_console_layout(0,0,25,5) --[[ s>0!: zum Kopieren, ans Ende der Console ziehen, Enter... & wieder einfügen | Bearbeiten/rückgängig... -- --A/CHDK/LOGS/LOG_0007.txt --A/CHDK/LOGS/LOG_1234.txt -- --]]--