Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread ik
On Wed, Jun 20, 2012 at 8:33 AM, LacaK wrote: > ** > Class helpers would not help ? > > http://wiki.freepascal.org/Helper_types > They can, but there is a protocol that I'm trying to create that provides me information what to execute (out of white list). The thing is, that the first request ma

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread LacaK
Class helpers would not help ? http://wiki.freepascal.org/Helper_types -Laco. Hello, Is there a way to tell in run-time that a specific function/procedure should belong to a class ? For example, let's say I have the following class: Type T

[fpc-pascal] Creating video files

2012-06-19 Thread Krzysztof
Hi, I would like to write video (created from series of bitmaps) to some popular video formats like avi, flv. Is this possible? Has FPC bindings for video librarys? I googled that WinFF (http://winff.org/html_new/) is written in FPC and Lazarus, so I supose that some bindings exists but can't find

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread JC Chu
Depending on what you’re actually trying to do, you may consider implementing your own invokable variant type. I found a tutorial at http://alex.ciobanu.org/?p=152. Basically, instances will be wrapped in a TVarData-compatible record, and your custom TInvokeableVariantType-derived class will allo

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread ik
On Tue, Jun 19, 2012 at 4:13 PM, Mattias Gaertner wrote: > ** > > > ik hat am 19. Juni 2012 um 14:22 geschrieben: > > Hello, > > Is there a way to tell in run-time that a specific function/procedure > should belong to a class ? > > For example, let's say I have the following class: > > Type >

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread Mattias Gaertner
ik hat am 19. Juni 2012 um 14:22 geschrieben: > Hello, > > Is there a way to tell in run-time that a specific function/procedure should > belong to a class ? > > For example, let's say I have the following class: > > Type >TTest = class > procedure Foo; >end; > > And I hav

[fpc-pascal] DOM and namespaces with prefix

2012-06-19 Thread Torsten Bonde Christiansen
Hi all. I am working on implementing a lite export routine from our program to the DDI XML format: http://www.ddialliance.org/Specification/DDI-Lifecycle/3.1/XMLSchema/ A convinient way of working with the DDI format is to prefix elements using common set of prefix'es, but having spent most

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread Jonas Maebe
michael.vancanneyt wrote on Tue, 19 Jun 2012: As far as I know there is no language structure for this, unless the objective C classes support offers this. You can indeed do that in Objective-C/Pascal, but a) that's not via a language construct, but by directly interacting with the runtime

Re: [fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread michael . vancanneyt
On Tue, 19 Jun 2012, ik wrote: Hello, Is there a way to tell in run-time that a specific function/procedure should belong to a class ? For example, let's say I have the following class: Type TTest = class procedure Foo; end; And I have also: procedure Bar; ... end; Is there a way to

[fpc-pascal] Adding method dynamically to a class

2012-06-19 Thread ik
Hello, Is there a way to tell in run-time that a specific function/procedure should belong to a class ? For example, let's say I have the following class: Type TTest = class procedure Foo; end; And I have also: procedure Bar; ... end; Is there a way to make at some point of my code ex

Re: RE : RE : [fpc-pascal] Dynamically Execute method

2012-06-19 Thread ik
On Tue, Jun 19, 2012 at 10:38 AM, Ludo Brands wrote: > > > As Bern said you can't call an object method without passing > > the reference to the instance. In this case you are lucky > > because TMyClass.SayHi doesn't use any properties or class > > vars. Add a property to TMyClass and try to writ

[fpc-pascal] Automatically exporting C++ API using SWIG??

2012-06-19 Thread Reinier Olislagers
The recent thread about using C headers made me think about using C++ projects. Found that the SWIG tool converts C/C++ .h files into glue code and bindings for e.g. Python, Modula 3... but not Delphi/Object Pascal. It seems you get an object-oriented binding. Did see this post from 2010 about D

RE : RE : [fpc-pascal] Dynamically Execute method

2012-06-19 Thread Ludo Brands
> As Bern said you can't call an object method without passing > the reference to the instance. In this case you are lucky > because TMyClass.SayHi doesn't use any properties or class > vars. Add a property to TMyClass and try to writeln that > property and you will see it fails. What you are

Re: [fpc-pascal] Dynamically Execute method

2012-06-19 Thread Mattias Gaertner
On Tue, 19 Jun 2012 00:22:29 +0300 ik wrote: > Hi, > > I'm playing a bit with the notion of execute a method dynamically on demand. > I'ved created the following PoC: > https://gist.github.com/2950789 > > It works, but for some strange reason, I find myself feeling that I'm > missing something,

RE : [fpc-pascal] Dynamically Execute method

2012-06-19 Thread Ludo Brands
> Seems to work for me, updated the example: https://gist.github.com/2950789 > > Or am O missing something ? Change your method to procedure TMyClass.SayHi; begin writeln('Hi World from '+IntToStr(ptruint(self))); end; And the test to write('From MyClass2 : '); MyClass2.SayHi; if not Exe