473,387 Members | 1,528 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,387 software developers and data experts.

how to get output from array element

3
In this program i created one array, while clicking on the get button it does not show the any output because the str variable is empty, how should i get proper output... Please help me




Expand|Select|Wrap|Line Numbers
  1. Partial Class dynamic_array
  2.     Inherits System.Web.UI.Page
  3.     Dim s(2) As String
  4.  
  5.     Dim str As String
  6.  
  7.  
  8.     Protected Sub btn_save_Click(sender As Object, e As System.EventArgs) Handles btn_save.Click
  9.  
  10.         Dim i As Integer = 0
  11.         For i = 0 To s.Length - 1
  12.             s(i) = InputBox("enter name " + (i + 1).ToString)
  13.         Next
  14.  
  15.  
  16.  
  17.     End Sub
  18.  
  19.     Protected Sub btn_get_Click(sender As Object, e As System.EventArgs) Handles btn_get.Click
  20.         Dim i As Integer = 0
  21.         str = ""
  22.  
  23.         For i = 0 To s.Length - 1
  24.             str &= s(i) + vbCrLf
  25.         Next
  26.  
  27.         MsgBox(str)
  28.  
  29.     End Sub
  30. End Class
Dec 12 '13 #1
1 1313
Fluke
2
Use breakpoints to halt the program so you can hover the mouse over a given variable to examine its contents. This will help you see the difference between your assumptions and the reality of what your code does.
Dec 13 '13 #2

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

Similar topics

7
by: richbl | last post by:
Hello all, I have a question about unserializing a single array element from a serialized array. Can this be done, or must I first unserialize the array, and then access the element? For...
2
by: csx | last post by:
Hi all, Here's a simple problem I'm having problems with. How do I pass an array element to a function. For instance, values = new values(1, 1,'A',0); values = new values(2, 2,'B',1);...
3
by: Kaz Kylheku | last post by:
Given some class C with array T x, is it possible to get a pointer-to-data-member to one of the elements? &C::x gives us a pointer-to-member-array: T (C::*). But I just want to get a T C::*...
4
by: garak | last post by:
Hi, I got the following problem : I have an defined an Array of different Actions: public PRootActions AllActions = new PRootActions ; I got a dynamic method where all Actions or other...
5
by: jtougas | last post by:
What is the way to the type of an array's elements? Array a = new long { 1, 2, 3 }; Type t = a.GetType(); Console.WriteLine( t.FullName ); This will write "System.Int64", but is not what I'm...
2
by: gregory_may | last post by:
Is there a way in VB.Net to declare a local variable that will manipulate an array element .... kind of like an item pointer to a global array?
7
by: Michael Bray | last post by:
Let's say I am using reflection to analyze my classes, and I have an array of another class. How do I get the base class that forms the array from a type? public class A { } A MyArray =...
2
by: getteddy | last post by:
hi i am working on array , i am facing a problem in comparing data base element with array element if not (objrs("namephase")=("despArray(ctr,0)+despArray(ctr,3)")) then or If...
5
by: dmorand | last post by:
I'm trying to validate whether or not an array element has been created. Here is what one of the arrays could look like: commentid = undefined commentid = undefined commentid = 1 commentid =...
13
by: tekinalp67 | last post by:
hi, i am trying to implement a B+ tree. There is no specification in the implementation so i am using arrays to implement the B+ tree. However, there is a problem that i encountered which is I...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.