473,614 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assigning Values to System.Array in VB.NET

11 New Member
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.CreateIns tance(GetType(S tring),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 4775
Nightfarer
11 New Member
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
8272
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: Peter = 10
1
2169
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 work. It works if the tags are <input type=radio...>. This line is OK:
2
3377
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 I can't get this to run in properly I get a syntax error (at or near ", output_txt_arr TEXT, output_str text ); CREATE OR REPLACE FUNCTION F_TEST(TEXT) RETURNS NUMERIC AS '
14
74829
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; myarray=0; myarray=1; myarray=8;
2
3267
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. Source Error: Line 553: AppDTO.zip = sZip Line 554: AppDTO.dob = sDOB '** line 555 is the highlighted row with the problem.
28
2428
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 1: Why cannot I do the following:
2
2525
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. Here is my code... Imports System.Web Imports System.Web.Services
37
2653
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 the equivalent (acceptable) code be this? = some_function_that_return_an_array();
6
2891
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 code is: gr.getGridArray(); for (int s=0;s<=NoOfElevations;s++) for (int t=0;t<=NoOfElevations;t++)
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.