|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
VB.Net Help w/ arrays Please!
Currently I have the following statement inside a module...
Public strQuestion(5) As String strQuestion(0) = "1. First" Currently I am getting a declaration expected error when i try to assign strQuestion(0)= "1. First" I want to be able to access the array inside my form. I could also place the array in the form but it is giving me the same error. To me it seems like I have declared the array and am trying to make an assignment... why does it say declaration expected? Any suggestions.. The overall idea here is to have an array of string that I can reference throughout my program... my program only has one form so that shouldn't be a huge difficulty... unfortunatly I must be doing something incredibly stupid. I would appreciate any help or suggestions. Thanks in advance, I really appreciate it. JA. |
|
#2
|
|||
|
|||
|
hopes this helps
Declare an array as module in the window Form designer
As the following: Dim mStringArray As String() = New String(40) {} Dim denotes Dimension m denotes module variable As String is data type new is dynamically creating an array 40 is the size of the array later: mStringArray(0) = "My String" If you do not want to declare an array variable as module then you must pass the array to other sub procedures (which are functions) Hoped i helped, Not claiming to be an expert just senior in college Edward Klemundt Jr. ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > VB.Net Help w/ arrays Please! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|