Re: [fpc-pascal] How to get rid of hint?

2006-05-21 Thread Florian Klaempfl
Mattias Gaertner wrote:
> On Sat, 20 May 2006 23:20:41 +0200
> Florian Klaempfl <[EMAIL PROTECTED]> wrote:
> 
>> Mattias Gaertner wrote:
>>> On Sat, 20 May 2006 22:50:17 +0200 (CEST)
>>> [EMAIL PROTECTED] (Marco van de Voort) wrote:
>>>
>   i:=PtrInt(p1)-PtrInt(p2);
 i:=prtint(p1-p2);
>>> Thanks. 
>>> So the trick to get convert a Pointer to an ordinal is to add/subtract
>>> something. For example:
>>> i:=PtrInt(p1-nil);
>>>
>>> Is there a better trick?
>> Let me ask the other way round: what do you want to achieve :)?
> 
> I have some classes, that implement quite abstract structures. Of course
> pascal wants a type, so they use a base type:  Pointer.
> Now I want to store PtrInt.
> And the other way round.
> So, I must type case from one to the other and back.
> With templates or some include file tricks I could probably avoid the
> problem.

Wait with this till 2.2 is finish and get first lazarus 1.0 out of the
door :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to get rid of hint?

2006-05-21 Thread Mattias Gaertner
On Sun, 21 May 2006 18:36:08 +0200
Florian Klaempfl <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > On Sat, 20 May 2006 23:20:41 +0200
> > Florian Klaempfl <[EMAIL PROTECTED]> wrote:
> > 
> >> Mattias Gaertner wrote:
> >>> On Sat, 20 May 2006 22:50:17 +0200 (CEST)
> >>> [EMAIL PROTECTED] (Marco van de Voort) wrote:
> >>>
> >   i:=PtrInt(p1)-PtrInt(p2);
>  i:=prtint(p1-p2);
> >>> Thanks. 
> >>> So the trick to get convert a Pointer to an ordinal is to add/subtract
> >>> something. For example:
> >>> i:=PtrInt(p1-nil);
> >>>
> >>> Is there a better trick?
> >> Let me ask the other way round: what do you want to achieve :)?
> > 
> > I have some classes, that implement quite abstract structures. Of course
> > pascal wants a type, so they use a base type:  Pointer.
> > Now I want to store PtrInt.
> > And the other way round.
> > So, I must type case from one to the other and back.
> > With templates or some include file tricks I could probably avoid the
> > problem.
> 
> Wait with this till 2.2 is finish and get first lazarus 1.0 out of the
> door :)

Well, 1000 bug reports ago I estimated that only 300 todo left. Lazarus 1.0
is a hydra.


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal