Wednesday, 15 September 2010

vb.net - Dynamically call functions/subs in method using variables -



vb.net - Dynamically call functions/subs in method using variables -

i found reply on here doesn't quite work, thought inquire looking for.

i have function names stored in database tied specific objects.

i query database, homecoming function name object, , i'm trying utilize info phone call function.

for example, have object 'bottle' , function called 'open bottle'. when i'm using 'bottle' want phone call 'open bottle'.

i found this:

callbyname(me, "functionname", calltype.method)

but doesn't work because have functions stored in separate method in code. in won't allow me pass in method in instead of me, , can't inherit because method.

i cannot alter method else because it's used in more 1 location throughout system, , potentially cause break.

is there alternative can use? tried using reflection ran same problem.

i'm using vb.net in visual studio 2010.

vb.net visual-studio-2010

No comments:

Post a Comment