Computer Science Canada

Array of Subroutines?

Author:  BigSams [ Fri Jan 21, 2011 1:56 am ]
Post subject:  Array of Subroutines?

For the sake of simplicity and efficiency, I need to create a subroutines array. I've managed to figure out control arrays and variable arrays so far but this has me totally stumped. Is this even possible? What is the syntax?
EDIT: any ideas on an array of functions too?
EDIT2: I seriously doubt that it is possible, but what the heck, I'll ask anyways. The best thing for the program's purpose would be 2-d subroutine arrays and 2-d function arrays. So are multidimensional arrays possible for subroutines and/or functions?

Author:  Tony [ Fri Jan 21, 2011 11:04 am ]
Post subject:  RE:Array of Subroutines?

Apparently so, if you dive into some assembly. http://www.codeproject.com/KB/vb-interop/NativeCode.aspx

This is much easier in other languages.

Author:  Insectoid [ Fri Jan 21, 2011 11:52 am ]
Post subject:  RE:Array of Subroutines?

This is possible in C via function pointers. I dunno about VB, though if it has support for pointers you probably can.

Author:  BigSams [ Fri Jan 21, 2011 7:31 pm ]
Post subject:  Re: Array of Subroutines?

@Tony, thanks but I have absolutely no clue what the code in that link means, even with the frequent comments. It seems rather overcomplicated though.
Is there a method suitable for a regular high school student? I can't even switch to a more convenient language because the school only allows vb6.. old piece of junk. Crashes everytime I try to move around a GIF -_-

Author:  Insectoid [ Fri Jan 21, 2011 7:38 pm ]
Post subject:  RE:Array of Subroutines?

Lots of 'if' statements.

Author:  Tony [ Fri Jan 21, 2011 7:52 pm ]
Post subject:  Re: Array of Subroutines?

BigSams @ Fri Jan 21, 2011 7:31 pm wrote:
Is there a method suitable for a regular high school student?

For VB6? Probably not.


: