Type
Line:Array[0..127] of Char;
Var
TmpBugStr:Line;
{later in the code}
Const
TempString : PChar = TmpBugStr;Mailing lists / fpc-devel / 2018-10
Porting from Delphi to FPC - challenge #2.
5 messages · 2 people · –
- OOzz Nixon 4
- DDenis Kozlov 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
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
Type Line:Array[0..127] of Char; Var TmpBugStr:Line; {later in the code} Const TempString…
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;Ozz Nixon wrote 9 lines
Type
Line:Array[0..127] of Char;
Var
TmpBugStr:Line;
{later in the code}
Const
TempString : PChar = TmpBugStr;
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;
