Board index » delphi » Passing functions as parameters in Turbo Pascal
Dirk.Loe...@student.kuleuven.ac.be (Dirk Loeckx)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Dirk.Loe...@student.kuleuven.ac.be (Dirk Loeckx)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Passing functions as parameters in Turbo Pascal
Hello,
can anybody please explain how I can pass procedures Thanx, Dirk Dirk.Loe...@student.kuleuven.ac.be |
sjh..
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Passing functions as parameters in Turbo PascalIn <4inegm$...@chaos.kulnet.kuleuven.ac.be>, Dirk.Loe...@student.kuleuven.ac.be (Dirk Loeckx) writes: Quote>Hello, {declare the function you want to pass as a data type } {declare another function which uses your first function as a variable} {implement it like so} {You can now use your function as a variable like so} If the function you're passing is in a a DLL, you'll have to EXPORT it. Scott Hanrahan |
Jeff
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Passing functions as parameters in Turbo PascalOn 19 Mar 1996 23:03:50 GMT, Dirk.Loe...@student.kuleuven.ac.be (Dirk QuoteLoeckx) wrote: Just call the desired procedure or function when it is needed. The only restriction is that you must of previously declared the function or procedure. Jeff |
David Peterso
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Passing functions as parameters in Turbo PascalQuoteJeff wrote: TYPE Procedure UseTrig ( Msg : String, Trig : TrigFunc ); Begin { UseTrig } Dave |
Pitbul
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Passing functions as parameters in Turbo PascalQuoteDavid Peterson <dpete...@isd.net> wrote: TrigFunc = Function ( Rad : Real ) : Real; Procedure UseTrig ( Msg : String, Trig : TrigFunc ); Begin { UseTrig } Quote
{ Quote} function tan(Rad:Real):real: begin tan:= sin(Rad)/cos(Rad); end; {$F-} var f:TrigFunc; -- "office": "leisure": |
Tim Di
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Passing functions as parameters in Turbo Pascalhey yur lucky.... Just follow the bouncing code Potions copywrite 1996 Nuclear Waste Software all rights reseverved function Figtriangle (base,height:real):real; function figcircle (area,radius:real):real;{local variables to the Function figtrap (top,base,height:real):real; Procedure Display_menu; Writeln (' The options that are avaiable to you are ');{menu} procedure triangle Writeln ('Please enter the base length and the height of the End; {end procedure triangle} Procedure circle procedure trap Begin Writeln; {displays a blank line} End. |
1. Turbo Pascal for Windows and Round function and randomize function
2. Passing Parameters to Assembly functions
3. passing a function parameter to a C dll
4. Passing a pointer to a procedure/function as a parameter in a procedure
5. Passing parameter to a function
6. Difference between parameters passed to a function
7. Passing a Variable number of parameters to a function
8. Passing PChar arrays as DLL function parameter