
-----------------------------------
BigSams
Fri Jan 21, 2011 1:56 am

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?

-----------------------------------
Tony
Fri Jan 21, 2011 11:04 am

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.

-----------------------------------
Insectoid
Fri Jan 21, 2011 11:52 am

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.

-----------------------------------
BigSams
Fri Jan 21, 2011 7:31 pm

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 -_-

-----------------------------------
Insectoid
Fri Jan 21, 2011 7:38 pm

RE:Array of Subroutines?
-----------------------------------
Lots of 'if' statements.

-----------------------------------
Tony
Fri Jan 21, 2011 7:52 pm

Re: Array of Subroutines?
-----------------------------------
Is there a method suitable for a regular high school student?
For VB6? Probably not.
