Recent

Author Topic: I can't find the error that FPC 2.6.4 is reporting  (Read 1691 times)

johngalt47

  • Newbie
  • Posts: 5
I can't find the error that FPC 2.6.4 is reporting
« on: November 07, 2015, 02:30:12 am »
PROGRAM trimstrings;

USES   dos, strings, strutils, sysutils;

var
   InString   :   String;
   OutString   :   String;
   TempStr   : String;
   InFile      :   TextFile;
   OutFile      :   TextFile;

   N            :   integer;
   x            :   integer;

begin

   assign(InFile,'c:\eb\APP44A.eb');
   reset(InFile);

   assign(OutFile,'c:\eb\test.txt');
   rewrite(OutFile);
   OutString := 'Just a placeholder';

   while not eof(InFile) do
   begin
      readln(InFile,InString);
      If (LeftStr(Instring,1) = '{') then do <<-- FPC says there is a problem with this line
      begin
         writeln(OutFile,OutString);
         close(OutFile);
      end

=============================

Does anyone see a problem with that line?

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: I can't find the error that FPC 2.6.4 is reporting
« Reply #1 on: November 07, 2015, 03:12:34 am »
Yes!

      If (LeftStr(Instring,1) = '{') then do <<-- FPC says there is a problem with this line

christian1987

  • New Member
  • *
  • Posts: 30
Re: I can't find the error that FPC 2.6.4 is reporting
« Reply #2 on: November 07, 2015, 07:01:02 am »
If (LeftStr(Instring,1) = '{') then BEGIN

 

TinyPortal © 2005-2018