opening; safetycheck;
if safetyvalue==1;
searching=1; retrievevalue=1;
searchstring=get(findobj('Tag','searchbox'), 'string');
pqsearching=pq(((ayatlist(from_surah,2)+from_ayah-1)*10+1):((ayatlist(to_surah,2)+to_ayah)*10)); %This extracts the section of quran we're searching
foundresults=find(cellfun('length',strfind(pqsearching,searchstring))); %performs the search, returns line number inside search selection
foundresults=(ayatlist(from_surah,2)+from_ayah-1)*10+foundresults; %converts search to master line number
foundresults1=1;
%case sensitive
%use divisibility to sort out ones not grabbing
checked1=100; checked2=100; checked3=100; checked4=100; checked5=100; checked6=100; checked7=100; checked8=100; checked9=100; checked10=100;
if get(findobj('Tag','khanbox'), 'value')==1; checked1=1; end;
if get(findobj('Tag','maulanabox'), 'value')==1; checked2=2; end;
if get(findobj('Tag','pickthalbox'), 'value')==1; checked3=3; end;
if get(findobj('Tag','rashadbox'), 'value')==1; checked4=4; end;
if get(findobj('Tag','sarwarbox'), 'value')==1; checked5=5; end;
if get(findobj('Tag','shakirbox'), 'value')==1; checked6=6; end;
if get(findobj('Tag','sheralibox'), 'value')==1; checked7=7; end;
if get(findobj('Tag','yusufalibox'), 'value')==1; checked8=8; end;
if get(findobj('Tag','ahmedalibox'), 'value')==1; checked9=9; end;
if get(findobj('Tag','salebox'), 'value')==1; checked10=0; end;
for counter=1:length(foundresults);
if (rem(foundresults(counter),10)==checked1 | rem(foundresults(counter),10)==checked2 | rem(foundresults(counter),10)==checked3 | rem(foundresults(counter),10)==checked4 | rem(foundresults(counter),10)==checked5 | rem(foundresults(counter),10)==checked6 | rem(foundresults(counter),10)==checked7 | rem(foundresults(counter),10)==checked8 | rem(foundresults(counter),10)==checked9 | rem(foundresults(counter),10)==checked10);
foundresults1(end+1,:)=ceil(foundresults(counter)/10);
end;
end;
foundresults1(1)=[];
foundresults1=unique(foundresults1);
if isempty(foundresults1);
set(findobj('Tag','displaybox'), 'string', {'No results found. Search is case sensitive.'})
else; retrieve;
end;
end;