Sign in Join

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

Mailing lists / fpc-devel / 2018-10

Porting from Delphi to FPC - challenge #2.

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Ozz Nixon
to Ozz Nixon

See Below - pressed enter too fast:

AM Ozz Nixon wrote 11 lines
Type Line:Array[0..127] of Char; Var TmpBugStr:Line; {later in the code} Const TempString : PChar = TmpBugStr;

Error: Incompatible types: got "Line" expected "PChar

Pointing to the last line. It happens through out the project, I am compiling -Mdelphi

Ozz

Reply by email

Ozz Nixon
to Ozz Nixon

If I type Cast TmpBugStr as PChar, then the error gets weird:

Error: Incompatible types: got "SYSTEM.PChar" expected "SYSTEM.PChar"

AM Ozz Nixon wrote 23 lines
See Below - pressed enter too fast: On Mon, Oct 1, 2018 at 8:18 AM Ozz Nixon wrote: > Type > Line:Array[0..127] of Char; > > Var > TmpBugStr:Line; > > {later in the code} > Const > TempString : PChar = TmpBugStr; > > Error: Incompatible types: got "Line" expected "PChar Pointing to the last line. It happens through out the project, I am compiling -Mdelphi Ozz

Reply by email

Ozz Nixon
to Denis Kozlov

Got it, thanks!

AM Denis Kozlov wrote 21 lines
PChar is a typed pointer, so you need to point it to the memory location of TmpBugStr using the "@" operator, like so: const TempString : PChar = @TmpBugStr; On 01/10/2018 13:18, Ozz Nixon wrote: Type Line:Array[0..127] of Char; Var TmpBugStr:Line; {later in the code} Const TempString : PChar = TmpBugStr;

Reply by email