Apologies if already suggested as there are a lot of messages in this thread -
but would this meet your needs:
tabulatorkindty = (tak_none=-1,tak_left,tak_right,tak_centered,tak_decimal);
This ensures -1 is a valid enum value so tabulatorkindty(-1) should not raise a
warning (I’ve not tried it
If you cast your “something” to a typed pointer, the compiler will do the work
for you in the usual way:
PDouble(something)^ := myDouble;
PAnsiString(something)^ := myAnsiString;
myRecordStructure := PMyRecordStructure(something)^;
Or less elegantly:
AnsiString(Pointer(something)^) := myAnsiSt
Interfaces support reference counting.
ISomeObject = interface
TSomeObject = class(TinterfacedObject, ISomeObject)
var
MyObj: ISomeObject;
Regards,
On 02 Feb 11, at 15:22 , Bo Berglund wrote:
> Will this create a memory leak or will FPC fnd by reference counting
> that nothing references the
On 30 Jan 11, at 22:28 , cobines wrote:
> it is now a pointer to IBaseInterface, because of implicit QueryInterface?
The reference changes because you have explicitly cast (the implementing
object) to another interface.
> So, I think I can compare interface variables but first I have to
> bring
A more detailed answer:
iDesc holds TDescClass as IDescInterface
iBase holds TDescClass as IDescInterface
iBaseAsBase holds TBaseClass as IBaseInterface
iBase holds the IDescInterface interface because they are compile-time
compatible (the same as an ancestor object reference holding an object f
Interfaces do not behave like classes. Each each interface
implemented/supported by a class is unique - at runtime a "descendent"
interface is entirely unrelated to its ancestor.
Regards Andrew.
On 30 Jan 11, at 20:37 , cobines wrote:
> Hello everyone,
>
> I have attached a program about wh
FWIW, both interface delegation ("implements") and "method aliasing" have been
supported in FPC for at least 2 years (we first tested/used them in January
2009 with FPC 2.2.2 which was released in August 2008).
* We have used method aliasing extensively - it appears to behave the same as
Bor
I suspect the reason is that the object still has a refCount of 1 when you free
it and this code raises the exception:
procedure TInterfacedObject.BeforeDestruction;
begin
if frefcount<>0 then
HandleError(204);
end;
You should never free an interfaced object di
The reason you cannot call VerifyID's from coGeneric is that the compiler sees
coGeneric as a TPersistentClass which does not implement the VerifyIDs method.
The following changes will give you the desired result...
type
TCoreObjectClass = class of TCoreObject;
If (coGeneric<>nil) and coGe
On 30 May 10, at 04:00 , spir ☣ wrote:
> So, it seems the language knows (at runtime) about the real type of a
> *value*. I must declare element, the variable, with type C, since I do not
> know anything at coding time. But Pascal correctly calls C1.text, due to
> "virtual" & "override" modifie
On 29 May 10, at 15:26 , spir ☣ wrote:
> I cannot do that. C0 (and all classes) instances need a text method. I also
> cannot have 2 methods (one static, one virtual) with different names. It's a
> basic feature, always called with the same name. Like getItem for a hierarchy
> of collections: ev
>> Do i need to explicitely name self as param?
self is a reserved keyword which represents the reference to the object of
context (much the same as using "result" in a function) - it is understood by
the compiler and does not need to be specified.
>> Is self actually a pointer? If yes, do I nee
Hi David,
If I'm reading your need correctly...
function CopyMyMammal(value: T_Mammal; extraParameters): T_Mammal;
begin
result := T_Mammal_Class(value.ClassType).Create(withExtraParameters);
end;
Only confusion is you say you cannot make the type conversion? But the above
code is correct and
ly by "assuming" " = 0", " = nil", etc at the end of
a global declaration if nothing else has been specified.
Regards,
Andrew Hall.
On 28 Nov 09, at 11:58 , Michael Van Canneyt wrote:
>> Global variables (even in the implementation section) are always
>>
you to cast to any interface supported by the host class: "I2 :=
I1.Owner as IIntf2"
PS - normally your host class would not support the interface you are using
"implements" to achieve... therefore the confusing circumstances of your first
example would not normally happen - yo
) requesting "IIntf2", which O does support, so the returned
"IIntf2" interface is still implemented by "O". When calling "I2.Print", "O"
as the implementing object returns 30.
When you comment out "implements", the only object implem
required or does the FPC library required modification?
2) Is there other advice the forum can offer (eg. does Classic remain
a reasonable choice, is SuperServer support planned, etc).
Thank you.
Regards,
Andrew Hall.
smime.p7s
Description: S/MIME cryptographic signature
__
is there a workaround? We require a decimal with at least 9
decimal places precision (?perhaps DOUBLE PRECISION)
3) the issue with negative numerics with TSQLQuery being treated as
unsigned, described in the bug list as fixed in FPC 231 - has this fix
been moved to FPC 224?
Thank you.
Regards,
A
18 matches
Mail list logo