error

khaled salem
khaled salem used Ask the Experts™
on
Hi all:
I've run my old program by Delphi 5, with Delphi 2010. the following error appear
"More than 1023 characters"
more thani am sure the line length less than 255 characters.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
What happens if you put the cursor before the semicolon and press END button on your keyboard?
khaled salemSoftware Developer

Author

Commented:
the cursor stop at the after the semicolon
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Can you copy the lines to a text file and upload it?

Which line is the error on?

mlmcc
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Commented:
You probably have some non-printable characters in your sourcecode line and/or your line breaks are non-Windows style.

Try this to convert your sourcecode file U123.pas...

procedure TForm1.Button1Click(Sender: TObject);
var
  sl : TStringList;
  s  : String;
  i  : integer;
begin
  if OpenDialog1.Execute then begin
    sl := TStringList.create;
    sl.LoadFromFile(OpenDialog1.FileName);
    s := AdjustLineBreaks(sl.text);
    for i := 1 to length(s) do begin
      if (s[ i ] < ' ') and not (s[i] in [#13,#10]) then begin
        s [ i ] := ' ';
      end;
    end;
    sl.text := s;
    sl.SaveToFile(OpenDialog1.FileName+'.new');
  end;
end;

Open in new window

Above code adjusts line breaks to Windows style and replaces non-printable characters with spaces...
Top Expert 2014

Commented:
As a follow-up on the Thommy comment, I see non-ASCII characters in your
If Query3333['name']=

Open in new window

statement.

Commented:
@aikimark
I've also recognized your mentionend characters.
These chars will also be handled by my suggested solution...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial