the_way 52 Posted September 4, 2013 Report Share Posted September 4, 2013 Is it possible to pass a command into a function? Just doing a bit of thinking and wondering if this is something that can be achieved. I don't think so, but i'd love to be wrong. obviously you can pass a variable into a function, but what about a whole command. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 4, 2013 Report Share Posted September 4, 2013 Can you give an example of what you would use this for? Quote Link to post Share on other sites
the_way 52 Posted September 5, 2013 Author Report Share Posted September 5, 2013 say i had a generic error checking function, that would get a command passed into it, the command would run as normal, however it would be wrapped with an error checking function too. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 5, 2013 Report Share Posted September 5, 2013 Why would it need to be passed though? You can pass a variable that contains true or false to have the option to run a command inside of a function if you only need it to run under certain conditions. Quote Link to post Share on other sites
the_way 52 Posted September 7, 2013 Author Report Share Posted September 7, 2013 If you look up some c# code, you can see examples of it there, thats what first brought me to thinking about the idea. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.