Re: [fpc-devel] Porting from Delphi to FPC - challenge #2.
Got it, thanks! On Tue, Oct 2, 2018 at 7:57 AM Denis Kozlov wrote: > 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; > > > ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] Porting from Delphi to FPC - challenge #2.
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; ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] Porting from Delphi to FPC - challenge #2.
If I type Cast TmpBugStr as PChar, then the error gets weird: Error: Incompatible types: got "SYSTEM.PChar" expected "SYSTEM.PChar" On Mon, Oct 1, 2018 at 8:20 AM Ozz Nixon wrote: > 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 > ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] Porting from Delphi to FPC - challenge #2.
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 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel