[Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

Marcos Douglas B. Santos md at delfire.net
Thu May 4 06:05:42 CEST 2017


On Wed, May 3, 2017 at 9:37 AM, Mattias Gaertner via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:
>> Hmmm... why does FPC not understand the BOM?
>
> It does. And so does Delphi. But with and without BOM have different
> meanings.
>
>
>> > You are right, that using Unicode with Lazarus only needs a couple of
>> > rules to follow. Sharing code with Delphi adds a few more rules.
>>
>> One valid choice is to edit in Lazarus and copy to Delphi only to be
>> built. I understood Marcos Douglas planned something like that.
>> If code really must be edited in both, how to solve it?
>
> That's what I tried to explain to Marcos and what you described as
> "That must be very confusing."
>
>
>> This was another complication I did not think about. :(
>>
>> About the couple of rules to follow, I had these in mind:
>>  1. Normally use type "String".
>>  2. Assign a constant always to a type String variable.
>>  3. Use type UnicodeString explicitly for API calls that need it.
>
> 4. When sharing code with Delphi use BOM or use only ASCII constants.
> You can choose for each unit. Either way load texts using
> resourcestring or similar techniques.
>
> 5. What about Char and aString[]?
> 6. What about PChar?

I got it.

Best regards,
Marcos Douglas


More information about the Lazarus mailing list