cb3a4064   
   From: berdontemail@caneris.ca   
      
   "Eureka" wrote in message   
   news:18cd7724-3fe2-4a6b-af46-c370f9fc244b@a12g2000yqm.googlegroups.com...   
   On Feb 23, 4:47 pm, Jim Leonard wrote:   
   > On Feb 21, 1:19 pm, Eureka wrote:   
   >   
   > > Hey guys,   
   >   
   > > I have a problem. I want call my functions in pascal by their names   
   > > stored in an array for example.. (array[1..n] of string).. i want the   
   > > same of PHP call_user_func function.. or something near that.. Is   
   > > there any way to do this?   
      
   > Marco van de Voort: I tried what u wrote but i got error 143. I readed   
   > stg about far functions.. Can that help?   
   >   
   > Jim Leonard: I want to make easily expandable and modular classes   
   > which can add their own functions for the main class.   
   >   
   > for example: we have u1 and u2 units with the u1_execute and   
   > u2_execute procedures/functions. I want that if i use u1 and/or u2   
   > unit, that unit can add that function to an array or something else..   
   > And the main program can call all of these.   
      
   There is a difference between procedures, functions, and procedure/function   
   methods. Delphi and Pascal, for that matter, are compiled languages not   
   interpreted or run-time compiled.   
      
   If you are adding published methods to a tObject descendent you may be able   
   to use its MethodAddress method to get a pointer to an address. I haven't   
   tried this so I can't comment on its use. An alternative would be to use the   
   typInfo unit and publish the new methods as method properties.   
      
   I think though that you may want to reconsider what you are trying to do. I   
   suspect that you are basing your design on an incomplete understanding of   
   the structure/construction of a Delphi program. Unless you are using a   
   runtime library, when you add a new method to a class you will have to   
   recompile any program that uses that class before you will be able to use   
   the method. So modifying the main program can be done at no additional cost   
   and you can reference the new method directly using its name.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|