Click here to Skip to main content
15,888,235 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: System.byte[] returned for AD Query (asp.net/C# web app) Pin
Matt Martinez6-Jul-07 8:00
Matt Martinez6-Jul-07 8:00 
QuestionHow to search for hard coded string in VC++ code Pin
Neeranjan3-Jul-07 3:46
Neeranjan3-Jul-07 3:46 
AnswerRe: How to search for hard coded string in VC++ code Pin
Dave Kreskowiak3-Jul-07 5:21
mveDave Kreskowiak3-Jul-07 5:21 
AnswerRe: How to search for hard coded string in VC++ code Pin
l0kke3-Jul-07 5:41
l0kke3-Jul-07 5:41 
AnswerDO NOT CROSSPOST Pin
leckey3-Jul-07 8:19
leckey3-Jul-07 8:19 
AnswerThe rules Pin
leckey3-Jul-07 8:18
leckey3-Jul-07 8:18 
QuestionArray name is in a variable Pin
peacefulmember29-Jun-07 9:35
peacefulmember29-Jun-07 9:35 
AnswerRe: Array name is in a variable Pin
Dave Kreskowiak29-Jun-07 9:49
mveDave Kreskowiak29-Jun-07 9:49 
If you're looking at doing something like this, you most certainly don't need it. If your code is smart enough to pass in the correct array name and element number, it's smart enough to just do Dim str As String = upperCases(x) without going to a function to do it.


You cannot do what you want, how you to do it. It would take using Reflection methods to do something like this. It would also be a very expensive operation to return a value, so if performance is an issue, this isn't they way to do it.

You'd have to do something like this:
Public Function getText(ByVal pos As Integer, ByVal arrayName As String) As String
    Select Case arrayName
        Case "upperCases"
            Return upperCases(pos)

        Case "lowerCases"
            Return lowerCases(pos)

        Case Else
            Throw New ArgumentException("Invalid array name passed!")
    End Select
End Function



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Array name is in a variable Pin
peacefulmember2-Jul-07 4:21
peacefulmember2-Jul-07 4:21 
GeneralRe: Array name is in a variable Pin
Dave Kreskowiak2-Jul-07 12:38
mveDave Kreskowiak2-Jul-07 12:38 
QuestionCollection<> to KeyedCollection<T,K> Pin
Santiago Perez29-Jun-07 9:13
Santiago Perez29-Jun-07 9:13 
AnswerRe: Collection to KeyedCollection Pin
Robert Rohde1-Jul-07 2:21
Robert Rohde1-Jul-07 2:21 
GeneralRe: Collection to KeyedCollection Pin
Santiago Perez1-Jul-07 16:48
Santiago Perez1-Jul-07 16:48 
QuestionSQL Membership Password Reset problem Pin
Vipul Mehta29-Jun-07 1:47
Vipul Mehta29-Jun-07 1:47 
AnswerRe: SQL Membership Password Reset problem Pin
kubben29-Jun-07 6:07
kubben29-Jun-07 6:07 
GeneralRe: SQL Membership Password Reset problem Pin
Vipul Mehta30-Jun-07 18:49
Vipul Mehta30-Jun-07 18:49 
GeneralRe: SQL Membership Password Reset problem Pin
kubben1-Jul-07 0:57
kubben1-Jul-07 0:57 
QuestionWPF - How to show a webpage in a 3D surface Pin
sinosoidal28-Jun-07 23:54
sinosoidal28-Jun-07 23:54 
Questionbutton style Pin
Sunshine Always28-Jun-07 23:25
Sunshine Always28-Jun-07 23:25 
AnswerRe: button style Pin
Paul Conrad13-Jul-07 13:05
professionalPaul Conrad13-Jul-07 13:05 
QuestionDecryting Passwords stored in aspnet_Membership table Pin
Vipul Mehta28-Jun-07 22:26
Vipul Mehta28-Jun-07 22:26 
AnswerRe: Decryting Passwords stored in aspnet_Membership table Pin
originSH29-Jun-07 0:15
originSH29-Jun-07 0:15 
AnswerRe: Decryting Passwords stored in aspnet_Membership table Pin
Vasudevan Deepak Kumar29-Jun-07 1:34
Vasudevan Deepak Kumar29-Jun-07 1:34 
QuestionGetting real sender of HelpRequested events Pin
m_g_a28-Jun-07 20:40
m_g_a28-Jun-07 20:40 
AnswerRe: Getting real sender of HelpRequested events Pin
Robert Rohde1-Jul-07 2:25
Robert Rohde1-Jul-07 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.