[fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
Hello! I have a record containing a set of variables. This record should now be accessed from an application developed in C (through a shared library). Because Pascal records are incompatible with C structs, I could write a get_value() function for each value in the record, e.g. if I have: TTestRe

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Bernd Kreuss
On 01.08.2010 14:45, Matthias Klumpp wrote: > Because Pascal records are incompatible with C structs how are they incompatible? It should be possible to define the same record as a struct in C and for every struct in C it should be possible to define the same as a record in Pascal. Then you could

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
On Sun, 01 Aug 2010 19:27:20 +0200, Bernd Kreuss wrote: > On 01.08.2010 14:45, Matthias Klumpp wrote: > >> Because Pascal records are incompatible with C structs > > how are they incompatible? It should be possible to define the same > record as a struct in C and for every struct in C it should

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-01 Thread Matthias Klumpp
On Sun, 01 Aug 2010 19:57:28 +0200, Matthias Klumpp wrote: > On Sun, 01 Aug 2010 19:27:20 +0200, Bernd Kreuss > wrote: >> On 01.08.2010 14:45, Matthias Klumpp wrote: >> >>> Because Pascal records are incompatible with C structs >> >> how are they incompatible? It should be possible to define th

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-02 Thread Jonas Maebe
On 01 Aug 2010, at 14:45, Matthias Klumpp wrote: I have a record containing a set of variables. This record should now be accessed from an application developed in C (through a shared library). Because Pascal records are incompatible with C structs If you use {$packrecords c}, then record

Re: [fpc-pascal] Something like g_object_get() in Pascal?

2010-08-02 Thread Felipe Monteiro de Carvalho
On Sun, Aug 1, 2010 at 2:45 PM, Matthias Klumpp wrote: > Is there a possibility to get the same function in Pascal to? That I just > define one get_value() function which receives the property name as string > and outputs the value of it? I don't know about getting the value of a property, but yo