By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

Passing Data Types To A Function

P: 1
Using VB.Net

Could someone please tell me how to pass a type to a function, for example.

MyFunction (“Name” , Integer)
---------------------------------------
Public Function MyFunction (ByVal MyName as String , ?????????)

End function
Jan 9 '08 #1
Share this Question
Share on Google+
4 Replies


jamesd0142
100+
P: 469
why can't you do this...

Public Function MyFunction(ByVal MyName As String, ByVal a As Integer)

End Function

MyFunction(“Name” , 123)
Jan 9 '08 #2

werks
100+
P: 220
I agagreewith james


Better Than Yesterday (-.-)
Jan 9 '08 #3

Expert 5K+
P: 8,434
Ignore them, CloeteJ, they obviously didn't understand the question. :)

In VB6 you can test, for example, If TypeOf Object Is OptionButton. Perhaps you can search your documentation for extensions to this.
Jan 10 '08 #4

QVeen72
Expert 100+
P: 1,445
Using VB.Net

Could someone please tell me how to pass a type to a function, for example.

MyFunction (“Name” , Integer)
---------------------------------------
Public Function MyFunction (ByVal MyName as String , ?????????)

End function
Hi,

I guess, your Function Returns Integer, so to define that :

Expand|Select|Wrap|Line Numbers
  1. Public Function MyFunction (ByVal MyName as String ) As Integer
  2. End function
  3.  
Regards
Veena
Jan 10 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.