args Path, FileName, Comment, Action local Source = Path ++ "descript.ion" local CR = esc(?+\n+, ?+\+) local Quote = esc(?+\"+, ?+\+) local AsQuote = "|" local Config = pprofolder ++ "scripts\ini\Descript_ion.ini" local fh, Str, SomeFile, Temp, NotComms, Delim if(ini.check_exists(Config, "Options", "Delimiter") == 3) Delim = ini.get(Config, "Options", "Delimiter") if(index(FileName, " ")) FileName = AsQuote ++ FileName ++ AsQuote if(not file.validpath(Source)) do if(index("drg", Action)) quit("ERROR: no comment file") fh = file.open(Source, "w") if(fh <= 0) do messagebox("ok error", "File not opened", "FILE plugin error #12") quit all endif file.writeline(fh, replacechars(FileName, AsQuote, Quote) ++ " " ++ Comment) file.close(fh) quit else fh = file.open(Source, "r") if(fh <= 0) do messagebox("ok error", "File not opened", "FILE plugin error #11") quit endif endif local M = map.create(10, 1) flag set 1 for(not(file.eof(fh))) Str = file.readstring(fh) if(not Str) continue SomeName = word(Str, 1) if(file.validpath(Path ++ SomeName)) do Temp = select(Str, length(SomeName) - length(Str) + 1) else SomeName = word(Str, 1, Quote) if(not file.validpath(Path ++ SomeName)) do NotComms = NotComms ++ Str ++ CR continue else SomeName = AsQuote ++ SomeName ++ AsQuote Temp = select(Str, length(SomeName) - length(Str) + 1) endif endif if(SomeName == FileName) do if(Action == "g") do map.destroy(M) file.close(fh) quit(Temp) elseif(Action == "r") do M[FileName] = Comment flag clear 1 elseif(Action == "b") do M[FileName] = Comment ++ Delim ++ Temp flag clear 1 elseif(Action == "a") do M[FileName] = Temp ++ Delim ++ Comment flag clear 1 endif else M[SomeName] = Temp endif endfor if(index("s", Action)) M[FileName] = Comment if(index("bar", Action) && pproflag(1)) M[FileName] = Comment file.close(fh) file.delete(Source) fh = file.open(Source, "w") if(fh <= 0) do messagebox("ok error", "File not opened", "FILE plugin error #13") quit all endif if(NotComms) file.writeline(fh, NotComms ++ CR) map.restart(M) for(not(map.eof(M))) Str = map.getnext(M) if(not Str) continue file.writeline(fh, replacechars(Str, AsQuote, Quote) ++ " " ++ M[Str]) endfor file.close(fh) map.destroy(M)