Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Peter
On 06/04/16 12:23, Graeme Geldenhuys wrote: > Hi, > ... > >>From the FPC documentation I noted the following: > > "The difference between objects and classes is mainly that an object is > allocated on the stack, as an ordinary record would be, and that classes > are always allocated on the

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 12:23, Graeme Geldenhuys wrote: > Are there pros or cons to either? Thanks for the replies everybody. From the answers I've seen thus far I came to the conclusion that if the code which uses Object style objects works, there is no real reason or urgency to port that code to Class

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 16:28 schrieb "Dennis" : > > objects unit contains >TObject = OBJECT > CONSTRUCTOR Init; > PROCEDURE Free; > FUNCTION Is_Object(P:Pointer):Boolean; > DESTRUCTOR Done; Virtual; >END; > > > On the other hand, objpash.inc contains

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Dennis
objects unit contains TObject = OBJECT CONSTRUCTOR Init; PROCEDURE Free; FUNCTION Is_Object(P:Pointer):Boolean; DESTRUCTOR Done; Virtual; END; On the other hand, objpash.inc contains TObject = class public { please don't change the order of

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Tomas Hajny
On Wed, April 6, 2016 15:13, Vojtěch Čihák wrote: > How can I do it? >   > When I try do: >   > TMyObj = object(TObject) >   > compiler tells me: >   > Error: The mix of different kind of objects (class, object, interface, > etc) isn't allowed You need to add unit Objects to the uses clause (see

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversionx

2016-04-06 Thread Mattias Gaertner
On Wed, 06 Apr 2016 15:05:02 +0200 tobiasgie...@gmail.com wrote: > Hello, > > Jonas wrote: > > If you get ASCII, it means that one of the LC_ALL, LC_CTYPE and/or LANG > > environment variables is set to > > a setting that corresponds to ASCII (such as "C"), or set to a value that > > is not

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversionx

2016-04-06 Thread Jonas Maebe
tobiasgiesen wrote on Wed, 06 Apr 2016: Jonas wrote: If you get ASCII, it means that one of the LC_ALL, LC_CTYPE and/or LANG environment variables is set to a setting that corresponds to ASCII (such as "C"), or set to a value that is not recognised as or translatable into a Windows code

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Vojtěch Čihák
How can I do it?   When I try do:   TMyObj = object(TObject)   compiler tells me:   Error: The mix of different kind of objects (class, object, interface, etc) isn't allowed   Thanks   V. __ Od: Tomas Hajny Komu:

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversionx

2016-04-06 Thread tobiasgiesen
Hello, Jonas wrote: > If you get ASCII, it means that one of the LC_ALL, LC_CTYPE and/or LANG > environment variables is set to > a setting that corresponds to ASCII (such as "C"), or set to a value that is > not recognised as or translatable into > a Windows code page number. That was it -

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 13:23 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Hi, > > I use Class and Object data types frequently in my code. I like the fact > that Object data types can be used without first instantiating an > instance and it gets freed automatically. Note: with the

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Sven Barth
Am 06.04.2016 14:06 schrieb "Tomas Hajny" : > > On Wed, April 6, 2016 13:26, Michael Van Canneyt wrote: > > On Wed, 6 Apr 2016, Graeme Geldenhuys wrote: > > Hi, > > >> I use Class and Object data types frequently in my code. I like the fact > >> that Object data types can be

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Tomas Hajny
On Wed, April 6, 2016 13:26, Michael Van Canneyt wrote: > On Wed, 6 Apr 2016, Graeme Geldenhuys wrote: Hi, >> I use Class and Object data types frequently in my code. I like the fact >> that Object data types can be used without first instantiating an >> instance and it gets freed automatically.

Re: [fpc-pascal] Class vs Object type

2016-04-06 Thread Michael Van Canneyt
On Wed, 6 Apr 2016, Graeme Geldenhuys wrote: Hi, I use Class and Object data types frequently in my code. I like the fact that Object data types can be used without first instantiating an instance and it gets freed automatically. But is there a technical (maybe compiler) reason why I should

[fpc-pascal] Class vs Object type

2016-04-06 Thread Graeme Geldenhuys
Hi, I use Class and Object data types frequently in my code. I like the fact that Object data types can be used without first instantiating an instance and it gets freed automatically. But is there a technical (maybe compiler) reason why I should possibly switch all my code to only using Class