473,383 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Assigning Values to System.Array in VB.NET

Hello.

I have a big trouble using System.Array class (it's the first time I use it) for a software I'm developing.

I have a form with a textbox(numbers) and one button (done).
Once the number is added to textbox clicking the done button saves the number in a variable (Numbers).
The next form has a textbox(letter) and two buttons (add new, done).
Values inserted in textbox are the values to be added to Array clicking add new button (the lenght of Array is Numbers variable).
It must do a cycle and when last item of lenght is done (so when Numbers lenght is reached) the add new button must not be visible anymore so to have only done button to proceed.
At each add new click obviously the next letter added should be put in next position in array and textbox must be cleared to add new value.

Numbers is an integer
letter is a string

I create the Array in this way:
LettersArray = Array.CreateInstance(GetType(String),Numbers)

For the cycle I used something like

for i as integer = 0 to Numbers
Array.SetValue(letter, Numbers)
textbox.clear()
If i = Numbers then Exit For
Next i

I continue to receive IndexOutOfRange Exceptions.

Hope someone explain and help me why it doesn't work and solve the issue.

Thanks in advance,
Luca
Sep 11 '07 #1
1 4746
Hello.

I solved the loop issue and assignement of values to array but I have another one:
the loop doesn't wait the new user input given by textbox and passed to array routine by the click event but add the same letter to all array length.

The form and routine must work this way:
1) User adds value in textbox and the click event of add new button should pass the value to array routine (starting the loop) and clear textbox
2) Routine must wait the user to pass new value via textbox and new add new button click so there must be a WAIT for the loop
3) Step 2 must be repeated for the entire loop (using array length)
4) Once all values are given and assigned (so after finishing loop) add new button must be invisible or inactive and there's the done button to proceed.

How do I solve this?
Please, it's urgent.

Luca
Sep 12 '07 #2

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

Similar topics

3
by: Ben | last post by:
Hi all, This may sound easy but I'm having trouble assigning values to array element. My problem is as follows: m = for o in m: # Here first o is 'Peter'.. I want to do something like this:...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
2
by: Zitan Broth | last post by:
Greetings All, Running pg 7.3.4 and was reading: http://archives.postgresql.org/pgsql-interfaces/2003-09/msg00018.php . Basically want to assign values to an array and then a 2d array. However...
14
by: Eric Bantock | last post by:
Very basic question I'm afraid. Once an array has been declared, is there a less tedious way of assigning values to its members than the following: myarray=8; myarray=3; myarray=4; myarray=0;...
2
by: ryoung | last post by:
I receive the following error when I attempt to assign values to a web service array. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. ...
28
by: anonymous | last post by:
I have couple of questions related to array addresses. As they belong to the same block, I am putting them here in one single post. I hope nobody minds: char array; int address; Questions...
2
by: Military Smurf | last post by:
I am interested in dumping some results from a collection I have into a group of variables. I have a counter that loops but I don't know how to use the counter to determine my variable names. ...
37
by: miken32 | last post by:
In PHP, if a function returns an array it's fairly common to capture its return values like this: <?php list($foo, $bar, $baz) = some_function_that_return_an_array(); ?> In Javascript, would...
6
by: sumuka | last post by:
Hello, I'm doing a project in java and im not able to assign the values which are got from for loop to the 2-dimensional array. Can anyone tell me how to assign the values and print them? the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.