Solved

Hard Code Values to an Array

Posted on 2009-03-29
3
579 Views
Last Modified: 2012-05-06
Hi EE.

I am not great with regular arrays, but I am attempting to create an array that will hold values a.b.c.d.e.f etc. depending on how many columns I have.
I retrieve the number of columns and then assign it to the array, but how do I assign the a,b,c etc. to the array  and how do I pick the values out?
Thanks
Dim cc As Integer = Me.fpGrdGeneric.ActiveSheet.ColumnCount - 1
 Dim arr(cc) As Array = a,b,c,??

Open in new window

0
Comment
Question by:Sheritlw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 24016730
maybe some tips as described here may help? http://www.vb-helper.com/howto_net_declare_arrays.html
0
 
LVL 6

Accepted Solution

by:
HarryNS earned 250 total points
ID: 24016752
Dim Test() As Integer
        Test = New Integer() {1, 3, 5, 7, 9}

        Dim Test1() As String
        Test1 = New String() {"a", "b", "c", "d"}
0
 
LVL 47

Assisted Solution

by:Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs) earned 250 total points
ID: 24016781
For a start, you need to declare it as String, as the way you have it is declaring an array of Arrays.

Then you need to fill it like this....

        Dim arr(cc) As String
        For c As Integer = 0 To cc - 1
            arr(c) = Chr(65 + c).ToString
        Next

Wayne
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question