Re: [fpc-pascal]Class Identification?
hi, Jon! > Heya ^_^ Is it possible to identify the class type? > > For example TypeOf(MyClass) = TypeOf(MyClass)? > > Is it possible to register diffrent types of classes at startup and then > identify them later? > > This is probably a simple matter solvable with a few calls from the > System unit that are well documented. But honestly.. I didn't see any! > ^_^ > > > Any hints/suggestions would be much appreciated. for descendants of TObject, there's a method 'ClassType', e. g. *** begin if MyObject.ClassType = CCalculator then begin bla bla end else bla bla end; *** see reference manual - system unit. this only works if a descendant of TObject has been assigned to MyObject. Anton. -- "Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben." Doris Langley Moore: Ada, Countess of Lovelace (London 1977). -- Anton Tichawa Volkertstrasse 19 / 20 A-1020 Wien mobil: +43 664 52 07 907 email: [EMAIL PROTECTED] -- ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Class Identification?
> for descendants of TObject, there's a method 'ClassType', e. g. > > *** > begin > if MyObject.ClassType = CCalculator then begin > bla bla > end else bla bla > end; > *** > > see reference manual - system unit. this only works if a descendant of > TObject has been assigned to MyObject. > > Anton. Thanks. ^_^ I just maid my base class a descendant of TObject and that took care of it! ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal]error msg when compiling gluttest example under linux
Hello I installed FPC 1.0.6 on my Mandrake System. All in the default path /usr/local I tried to compile some programs, it worked only with console programs, who not need a special lib or unit. I tried to compile a gluttest.pp, from the example package, but there comes allways the error msg .. cant find GLU unit I looked in the fpc.cfg , and I changed some paths, because the units are in /usr/local/doc/fpc/1.0.6/examples/opengl .. but also with that change the same problem. Actually, there is no GLU unit .. only a GLU lib in my /usr/lib dir. By the way, I have also a working Mesa 5 Version installed. Linking problems also with the svga samples ... lvga ..cannot find bla..bla.. Please give me some feedback, a snapshot from your fpc.cfg woud be nice, that works with the default fpc installation -- __ http://www.linuxmail.org/ Now with e-mail forwarding for only US$5.95/yr Powered by Outblaze ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Class Identification?
On Sun, 2003-03-23 at 16:00, Jon David Sawyer wrote: > > for descendants of TObject, there's a method 'ClassType', e. g. > > > > *** > > begin > > if MyObject.ClassType = CCalculator then begin > > bla bla > > end else bla bla > > end; > > *** > > > > see reference manual - system unit. this only works if a descendant of > > TObject has been assigned to MyObject. > > > > Anton. > Thanks. ^_^ I just maid my base class a descendant of TObject and that > took care of it! btw, all classes are implicit descendants of TObject. If you don't specify any base class, the class will be derived from TObject directly: type TMyClass = class procedure Something; ... end; TMyClass is automatically inherited from TObject Both postings sound like this wasn't clear... - Sebastian ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal]Working with pictures in FPC - how?
Hello! I would like to write a program which works with pictures. For that, I will need two procedures for reading and writing a picture in/out to/from memory and hereby decoding/encoding it into a usable format which can be handled easily from FPC. I can imagine four lists of byte for CMYK (where every byte represents an 8-bit value of one particular point, or three lists of byte for RGB. Because I am not interesting in re-inventing the wheel, I would like to use existing libraries for reading/writing the pictures, i.e. the libjpeg.so. I am sure that these libraries will do more or less exactly what I need in my case, because I need only very low-level functions. But I will need some kind of wrapper for them to make usage easier. When somebody has worked on that and could leave me some code to get better understanding, I will be very happy. -- Thanks in advance! mfg Ing. Rainer Hantsch -- .-. | \\|// Ing. Rainer HANTSCH - Hardware + Software | | (o o) Forget Windoze! -- We focus on L-I-N-U-X... | |--oOOo-(_)-oOOo--| | Ing. Rainer HANTSCH | mail: [EMAIL PROTECTED] | | Khunngasse 21/20| www: http://www.hantsch.co.at | | A-1030 Vienna | tel: +43-1-79885380fax: +43-1-798853818 | | ** A u s t r i a ** | handy: +43-664-9194382 UID-Nr: ATU 11134002 | '-' ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal]Class Identification?
> btw, all classes are implicit descendants of TObject. If you don't > specify any base class, the class will be derived from TObject directly: > > type > TMyClass = class > procedure Something; > ... > end; > > TMyClass is automatically inherited from TObject > > Both postings sound like this wasn't clear... > > > - Sebastian Indeed.. I did not know this. ^_^ Thank you very much. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal