method execution (fileName : string) (outText : Widget.text Widget.widget) : unit = (
let out_name_if = get_output_if fileName in
let out_name_ofmc = (temp_dir^(Filename.basename fileName)^".ofmc") in
let error_if_file = (out_name_if^".error") in
let error_ofmc_file = (out_name_ofmc^".error") in
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_ofmc) then ignore(Sys.remove out_name_ofmc);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_ofmc_file) then ignore(Sys.remove error_ofmc_file);
let entryDepthString = if (Entry.get entryDepth)="" then "" else (" -d "^(Entry.get entryDepth)) in
let entryPathString = if (Entry.get entryPath)="" then "" else (" -p "^(Entry.get entryPath)) in
ignore(Sys.command(hlpsl2if^" --stdout "^esc^fileName^esc^" >"^esc^out_name_if^esc^" 2>"^esc^error_if_file^esc));
ignore(Sys.command(ofmc^" "^esc^out_name_if^esc^" "^sessionString^entryDepthString^entryPathString^" > "^esc^out_name_ofmc^esc^" 2>"^esc^error_ofmc_file^esc));
Text.delete outText ~start:(`Linechar(0, 0),[`Linestart]) ~stop:(`End,[]);
if(Sys.file_exists out_name_ofmc) then (
let txt = readFile out_name_ofmc in
if(txt<>"")
then(
let (out_error, num_of_lines) = readFile_and_give_line_number error_if_file in
let warning= (if(num_of_lines >2) then ("\n----- Output error of if translator :\n\n"^out_error^"\n--------------- \n") else "") in
Text.insert ~index:(`End,[]) ~text:(warning^txt) outText
)
else(
if(Sys.file_exists error_if_file)
then Text.insert ~index:(`End,[]) ~text:(("\n----- Output error of if translator :\n\n")^(readFile error_if_file)) outText;
if(Sys.file_exists error_ofmc_file)
then Text.insert ~index:(`End,[]) ~text:(("\n\n\n----- Output error of OFMC :\n\n")^(readFile error_ofmc_file)) outText;
);
);
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_ofmc) then ignore(Sys.remove out_name_ofmc);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_ofmc_file) then ignore(Sys.remove error_ofmc_file);
)