% Surah check
safetyvalue=1;
if isempty(from_surah) | isempty(to_surah) | isempty(from_ayah) | isempty(to_ayah)
set(findobj('Tag','displaybox'), 'string', 'Location cannot be blank. Please enter From & To for Chapter and Verse');
safetyvalue=0;
end;
if from_surah>114 | to_surah>114;
set(findobj('Tag','displaybox'), 'string', 'The qur''an has only 114 chapters');
safetyvalue=0;
end;
if from_surah<1 | to_surah<1;
set(findobj('Tag','displaybox'), 'string', 'Chapter cannot be less than 1');
safetyvalue=0;
end;
if from_surah>to_surah;
set(findobj('Tag','displaybox'), 'string', 'From Chapter cannot be greater than To');
safetyvalue=0;
end;
%Ayat check
if from_surah>0 & from_surah<115
if from_ayah>to_ayah;
set(findobj('Tag','displaybox'), 'string', 'From Verse cannot be greater than To');
safetyvalue=0;
end; end;
if to_surah>0 & to_surah<115
if to_ayah>ayatlist(to_surah,3);
errormessage={['Chapter ', num2str(to_surah), ' has only ', num2str(ayatlist(to_surah,3)), ' verses.']};
set(findobj('Tag','displaybox'), 'string', errormessage);
safetyvalue=0;
end;end;
if from_ayah<1 | to_ayah<1;
set(findobj('Tag','displaybox'), 'string', 'Verses cannot be less than 1');
safetyvalue=0;
end;
if get(findobj('Tag','khanbox'), 'value')==0 & get(findobj('Tag','maulanabox'), 'value')==0 & get(findobj('Tag','pickthalbox'), 'value')==0 & get(findobj('Tag','rashadbox'), 'value')==0 & get(findobj('Tag','sarwarbox'), 'value')==0 & get(findobj('Tag','shakirbox'), 'value')==0 & get(findobj('Tag','sheralibox'), 'value')==0 & get(findobj('Tag','yusufalibox'), 'value')==0 & get(findobj('Tag','ahmedalibox'), 'value')==0 & get(findobj('Tag','salebox'), 'value')==0;
set(findobj('Tag','displaybox'), 'string', 'No translations checked. Please make a selection.');
safetyvalue=0;
end;