functions as parameter

Nebu
01-21-2004, 12:21 PM
I'm creating an advanced data storage class with multiple variables with different data types. I did well so far, but I wanted to add conditions to the variables. To ensure maximum compatibility, I would need to pass a shared function from a mustinherit class to the function processing the variables + conditions. Is it possible to add a function to a function call as parameter the same way it is possible in C++ ?

Greetz
Nebu

Optikal
01-21-2004, 12:35 PM
You can use delegates to do this. A delegate is essentially a type-safe function pointer. There is plenty of documentation in the .Net SDK.

If you look at any C# code also you will see alot of delegates since in C# you are forced to use delegates to do events (whereas VB.Net hides this from you).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum