.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 26th, 2004, 12:44 PM
zoopnfunk zoopnfunk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 zoopnfunk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 27th, 2004, 12:25 AM
Edward Klemundt Edward Klemundt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 Edward Klemundt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 15 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > VB.Net Help w/ arrays Please!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT