Sign in Join

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

Mailing lists / fpc-pascal / 2008-05

Pointer address into string

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Damien Gerard

Hi !

I would like to display in a lazarus application the address of a pointer.
For this, I use :

var s: string;
     p:pointer;
[...]
s := IntToStr(PtrInt(p))

However, I've got a warning (hint) from the compiler : Conversion between ordinals and pointers is not portable

What is the way to do this ?

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat
Damien Gerard

Hi !

I would like to display in a lazarus application the address of a pointer.
For this, I use :

var s: string;
    p:pointer;
[...]
s := IntToStr(PtrInt(p))

However, I've got a warning (hint) from the compiler : Conversion between ordinals and pointers is not portable

What is the way to do this ?

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat
ik
to Damien Gerard: Hi ! I would like to display in a lazarus application the address of a pointer. For this,…

Look at the Format function, you can tell it to display the address of a pointer in a string.

Ido

Damien Gerard wrote 34 lines
Hi ! I would like to display in a lazarus application the address of a pointer. For this, I use : var s: string; p:pointer; [...] s := IntToStr(PtrInt(p)) However, I've got a warning (hint) from the compiler : Conversion between ordinals and pointers is not portable What is the way to do this ? -- Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Damien Gerard
to ik
ik wrote
Look at the Format function, you can tell it to display the address of a pointer in a string.

Thanks !

Damien Gerard "Intelligence is 10 million rules." -- Douglas Lenat