[fpc-pascal] Property alias

2012-12-07 Thread Krzysztof
Hi,

Interfaces can have aliases for functions:

Function MyOtherFunction : Integer;
Function IMyInterface.MyFunc = MyOtherFunction;

Can normal object have aliases for properties? For example,
TControl.Caption. I would like to publish this property in my descendant as
"MyExtraText". Is this possible?

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

Re: [fpc-pascal] Property alias

2012-12-07 Thread michael . vancanneyt



On Fri, 7 Dec 2012, Krzysztof wrote:


Hi,

Interfaces can have aliases for functions:

   Function MyOtherFunction : Integer;
   Function IMyInterface.MyFunc = MyOtherFunction;

Can normal object have aliases for properties? For example,
TControl.Caption. I would like to publish this property in my descendant as
"MyExtraText". Is this possible?


Currently not.

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


Re: [fpc-pascal] Property alias

2012-12-07 Thread Howard Page-Clark

On 07/12/12 2:50, Krzysztof wrote:

Hi,

Interfaces can have aliases for functions:

 Function MyOtherFunction : Integer;
 Function IMyInterface.MyFunc = MyOtherFunction;

Can normal object have aliases for properties? For example,
TControl.Caption. I would like to publish this property in my descendant
as "MyExtraText". Is this possible?


You can, of course, define a MyExtraText property with a setter and 
getter that refer to an existing property (or data field if it is 
accessible).


Howard

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


Re: [fpc-pascal] Property alias

2012-12-07 Thread Krzysztof
Thanks


2012/12/7 Howard Page-Clark 

> On 07/12/12 2:50, Krzysztof wrote:
>
>> Hi,
>>
>> Interfaces can have aliases for functions:
>>
>>  Function MyOtherFunction : Integer;
>>  Function IMyInterface.MyFunc = MyOtherFunction;
>>
>> Can normal object have aliases for properties? For example,
>> TControl.Caption. I would like to publish this property in my descendant
>> as "MyExtraText". Is this possible?
>>
>
> You can, of course, define a MyExtraText property with a setter and getter
> that refer to an existing property (or data field if it is accessible).
>
> Howard
>
>
> __**_
> fpc-pascal maillist  -  
> fpc-pascal@lists.freepascal.**org
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal
>
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] FCL-JSON: Getting the data into pascal classes

2012-12-07 Thread Reimar Grabowski
Hi,

I have a relatively simple JSON object consisting of some integer and string 
fields and a large (500-50 entries) float array.
Following the parsedemo.pp I extract the values from JSON and put them in my 
pascal class. All works as expected only that I do not seem to find a method to 
copy the complete float array from the TJSONArray object to an array of double 
in one go. I can do it manually by traversing the array but wouldn't it be more 
convenient to have this functionality in TJSONArray (same for string, integer 
and other arrays). Am I missing something?

On another note. There is no automatic way to create an instance of a custom 
class from a TJSONObject or is there?
JSON: {"fooStr":"foobar","fooInt":700,"fooFloatArray":[1.1, 1.2, 1.3]}
Pascal:
TMyCustomClass = class
  fooStr: String;
  fooInt: Integer;
  fooFloatArray: array of double; 
end;

Thanks for any info on this matter.
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Searching for database libraries

2012-12-07 Thread Mark Morgan Lloyd
When using something like InitialisePostgres3(), if the approximate 
location of the database library (.so or .dll) is known, what's the most 
effective way of finding the exact file? Is there a single routine that 
does a recursive search?


The reason that I ask is that it appears that the most efficient way of 
getting libpq.dll for Windows is to install the ODBC drivers, and they 
go into a directory typically named like C:\Program 
Files\psql\ODBC\\bin where  is a version number.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal