Quote (roberts @ Jan. 13 2008,01:35) |
Also note that I am also now updating a Master List of all extensions. Use your browser to search it, or download it and use Beaver to search it. Or have fun with grep. |
Code Sample |
listfile="list.txt" inputfile=io.open(listfile) if not inputfile then print("can't open "..listfile) os.exit(1) end data=inputfile:read("*a") inputfile:close() function parse_info() if radio_buttons[1]:value()==1 then searchstring="Location:%s*"..inputs[1]:value() elseif radio_buttons[2]:value()==1 then searchstring="\nExtension.by:%s*"..inputs[2]:value() elseif radio_buttons[3]:value()==1 then searchstring="\nTitle:%s*"..inputs[3]:value() else searchstring=nil end if searchstring then for info in string.gmatch(data,"(Location:.-\n)Location:") do if string.find(info,searchstring) then print(info.."\n..........\n") end end end end w=fltk:Fl_Window(350,200,"MyDSL Info Search") radio_labels={"category","extension by","filename"} radio_buttons={};inputs={} for i=1,table.getn(radio_labels) do radio_buttons[i]=fltk:Fl_Radio_Round_Button(10,20*i,100,20,radio_labels[i]) inputs[i]=fltk:Fl_Input(120,20*i,200,20) end gobutton=fltk:Fl_Button(10,100,100,20,"go") gobutton:callback(parse_info) w:show() Fl:run() |
Quote |
I was thinking of something along the lines of QBE (Query By Example). |