DEFLNG a-z FUNCTION PBMAIN() STDOUT "plsdec2 - fancy mode ooooh!" STDOUT "winamp m3u decoder" STDOUT x$ = TRIM$(COMMAND$) IF RIGHT$(x$, 1) = """" AND LEFT$(x$, 1) = """" THEN x$ = MID$(x$, 2, LEN(x$)-2) END IF IF DIR$(x$) = "" OR x$ = "" THEN STDOUT "usage: plsdec filename.m3u" STDOUT EXIT FUNCTION END IF DIM thebiglist$(1 TO 10000) numsongs = 0 OPEN x$ FOR INPUT AS #1 DO UNTIL EOF(1) LINE INPUT #1, y$ IF LEFT$(y$, 8) = "#EXTINF:" THEN fc = INSTR(y$, ",") IF fc > 0 THEN INCR numsongs thebiglist$(numsongs) = MID$(y$, fc+1) END IF END IF LOOP CLOSE #1 ARRAY SORT thebiglist$() FOR numsongs, COLLATE UCASE curart$ = LCASE$(TRIM$(PARSE$(thebiglist$(1), "-", 1))) STDOUT "**A**" & TRIM$(PARSE$(thebiglist$(1), "-", 1)) & "**/A** **S**("; STDOUT TRIM$(PARSE$(thebiglist$(1), "-", 2)); FOR r = 2 TO numsongs thisart$ = LCASE$(TRIM$(PARSE$(thebiglist$(r), "-", 1))) IF thisart$ <> curart$ THEN STDOUT ")**/S**" STDOUT "**A**" & TRIM$(PARSE$(thebiglist$(r), "-", 1)) & "**/A** **S**("; curart$ = thisart$ ELSE STDOUT ", "; END IF STDOUT TRIM$(PARSE$(thebiglist$(r), "-", 2)); NEXT r STDOUT ")**/S**" STDOUT END FUNCTION