This is a CLI program with Windows 7 and Lazarus 1.6.0 and FPC 3.0.0. Here's the procedure in my main .pas file.
//#################################################################
procedure makemimetype();
var fn:string;
tfOut: TextFile;
begin
fn:=gApppath+'mimetype';
if (FileExists(fn)) then
//begin
try // Error: "Identifier not found 'try'""
begin
AssignFile(tfOut, fn);
// Create the file, write some text and close it.
rewrite(tfOut);
write(tfOut, 'application/epub+zip');
//ShowMessage('Created required "mimetype" file for you in EXE dir.');
CloseFile(tfOut);
end;
except
// If there was an error the reason can be found here
on E: EInOutError do
writeerr('File handling error occurred. Details: '+ E.ClassName+ '/'+ E.Message);
end;
//end;
end; // makemimetype
I get this error when I do Run, Build File but when I do Run, Build (SH-F9), I get no errors. Here are all the build errors:
Build File C:\chuck\compiler\lazarus\Projects\mkcli\mkepub.lpr: Exit code 1, Errors: 2
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win64 for x64
mkepub.lpr(229,3) Error: Identifier not found "try"
mkepub.lpr(230,5) Error: Syntax error, ";" expected but "BEGIN" found
What could be going on here?
Thank you.