Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Array of Subroutines?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
BigSams




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Insectoid




PostPosted: 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.
BigSams




PostPosted: 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 -_-
Insectoid




PostPosted: Fri Jan 21, 2011 7:38 pm   Post subject: RE:Array of Subroutines?

Lots of 'if' statements.
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: