Have a look at "callbacks"  : searching within delphi.about.com gives me some 
different links, one of them is 
http://delphi.about.com/od/windowsshellapi/l/aa082900a.htm

I think this should get you started.

regards

Andries


Bobby Clarke <[EMAIL PROTECTED]> wrote:     Hi
 
 
 I want to pass a function name (Y) as a procedure parameter. Can someone 
 tell me how to do this? My current solution was OK (just) for a couple 
 of forms but unwieldy and non-expandable for even 4 forms. I suspect the 
 answer is something to do with addresses and pointers but I have not 
 found a solution.
 
 I have had two dead-end thoughts:
 1. I could make a TMyForm which embeds the function Y but I am already 
 using this for something else and the number of types would double.
 2. If  the routine (RoutineX) were on a Form rather than a Unit, I could 
 set the calling Form as a property there before jumping over.
 
 
 Bobbie Clarke
 
 
 Problem
 
 FormA, contains function Y, and calls RoutineX which wants to use 
 function Y
 FormB, contains function Y, and calls RoutineX which wants to use 
 function Y
 
 
 Current Solution
 
 Unit UFormA
 
 public
    function Y(...)
 
   RoutineX(...,self);          // here I would prefer to pass the 
 function name Y
 
 function TFormA.Y(...)
 
 
 
 Unit Library
 
 procedure RoutineX(...,SendForm:TForm);
 ...
   if         (SendForm is TFormA) then Y1 := (SendForm as TFormA).Y(...)
   else if (SendForm is TFormB) then Y1 := (SendForm as TFormB).Y(...)
 
 
      

  -----------------------------------------------------
 Home page: http://groups.yahoo.com/group/delphi-en/
 To unsubscribe: [EMAIL PROTECTED] 

              

        SPONSORED LINKS   
                                                    C programming language      
                                 Computer programming languages                 
                      Java programming language                                 
                                    The c programming language                  
                     C   programming language                                   
    Concept of programming language                                             
                    
      
---------------------------------
   YAHOO! GROUPS LINKS 
 
    
    Visit your group "delphi-en" on the web.
    
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
 
    
---------------------------------
 
 
     

                
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new 
and used cars.

[Non-text portions of this message have been removed]



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to