Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-03

Line Ending FPC/Delphi

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

Curious as to how others handle the line endings when sharing code between delphi and lazarus/fpc? FPC has LineEnding and I think Delphi has something similar it inherited from the Kylix era, but I don't think it was called the same.

I was thinking of just creating my ifdef'd type.

Thanks,

Warm Regards, Lee

Reply by email

Felipe Monteiro de Carvalho
to Lee Jenkins

In my projects I usually have a file with only general constants, which is added by all others. In this file I add the following declaration:

{$IFNDEF FPC}
const
  LineEnding = #10#13;
{#endif}

The Virtual Magnifying Glass is a medium sized project which is compilable with Lazarus and Delphi. It may be useful for you to take a look at it's source code:

http://sourceforge.net/projects/magnifier

Felipe Monteiro de Carvalho

Reply by email

Sergei Gorelkin
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 8 lines
In my projects I usually have a file with only general constants, which is added by all others. In this file I add the following declaration: {$IFNDEF FPC} const LineEnding = #10#13; {#endif}

In Delphi this constant is called sLineBreak. For compatibility reasons, it exists in FPC as well. So using sLineBreak allows writing code without $ifdef's.

Regards,
Sergei

Reply by email