How To Declare A Simple Array And Intialises Its Values
Dec 30, 2009
i know how to declare a simple array and intialises its values, but i dont know how to get its results out of it. let me explain what i want.i've basically made like a Quiz, so the array(s) needs to hold 20 questions and 20 anwers. and i ve put these separately in each array, i.e. i have 2 arrays one with questions and the other with answers.when the user of my program presses ' get a Quiz Question', they retrive a question. Then the user types in an answer and using the submit button sends the answer for it to be verifed. how do u make sure that the question has a coressponding answer to it. as ive sed i have 2 separate arrays, i dont know how tell vb that when a particular question appears that it has a corresponding answer. If it matches a positive message appears, i.e.good otherwise wrong will appear.Also i need to randomize the way the questions appear in the quiz so they dont follow the same order when they are seen for the second time?
View 5 Replies
ADVERTISEMENT
May 18, 2009
I wanted to know how I could declare a 2D array and assign it values separately?
View 37 Replies
Feb 18, 2010
Why can't I declare values for an array inside a module?
View 2 Replies
Jun 13, 2011
What is the right way to declare an array
Dim lblname As Label() = New Label(get_num_of_children()) {}
Dim mealcheck As Integer() = New Integer(get_num_of_children()) {}
[code].....
View 2 Replies
Jun 7, 2012
I have a little syntax declare problem in VB.Net.
Dim proxy As USImportoerServiceTypeClient = DMRUtils.CreateAndConfigureClient()
Dim request As New USDeclare_I()
request.DeclareCollection = New US_ITypeDeclare() {}
[code]....
This above code do not work, becase the "US_ITypeDeclare() {}" is empty an only contains a new DeclareCollectionStructure
declare a KoeretoejErklaeringStructure to this an set this date value til "DeclareCollectionStructure.DeclareCollectionValidDate" ?
View 1 Replies
Apr 30, 2012
I Declare a 2D Unlimited array.My code:
Dim array As String(,) = New String(,) {}
array(0, 0) = "top left"
MsgBox(array(0, 0))
The problem is the msgbox shows nothing.
View 1 Replies
Sep 1, 2009
Is there a better (more compact or elegant) way of declaring a large array such as this?[code]...
View 3 Replies
Jun 21, 2010
I could have an array of players but I cant dim and array as new and my players are all a class I made called gameobject
View 4 Replies
Jan 14, 2008
Dim AttributeValuePairs() As Dictionary(Of String, String) = New Dictionary(Of String, String)
byt this i mean AttributeValuePairs is a Array of dictionaries
[code]......
View 4 Replies
Jun 4, 2011
following code in C#.net...
{
long filesize=Mystream.Length;
byte [] buffer=new byte[(int)filesize];
Mystream.Read(buffer,0,(int)Mystream.Length);
}
How To convert this code in vb.net......or same code in vb.net.
View 6 Replies
May 3, 2011
I'm trying to declare a array that I want to use in the module and in the forms. I like it to be usable all over but I cant get it to work.
I tried this code but when I want to use it in the module it says that it isn't declared.
Public Class Form1
Public ShuffleArray() As String
View 8 Replies
Nov 26, 2010
Assuming the array has 216 elements:
Dim Data As Integer() = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
[code].....
View 6 Replies
Nov 15, 2011
I am trying to declare a array within a structure, and it is not working. [code] So I want each league to have a single name and id and 20 players.Is there a way other than writing out dim player1, player2 etc.
View 3 Replies
Feb 2, 2011
"declare a two dimensional array of integers named intgrades.it should have 30 rows and 10 columns
View 1 Replies
Jan 11, 2012
Can anyone tell me how I would declare an array for data that will come from textboxes? Every example I find seems to be data that comes from an input box, and the array name would just be strInputbox, for example. However, in my case the user will input data into several textboxes (each named txtBox1, txtBox2, txtBox3, etc.) and I'm not sure how to write this.
Thank you.
View 13 Replies
May 3, 2009
I have built a new class lets say it is called class1
Public
Class Class1
Public s As String ' strings
End
now in my program I want to create an array of them in on the windows form, how do I do this?Class
View 2 Replies
Jan 27, 2010
How do you declare an array when the array is initially empty?? I am taking multiple measurements from a meter that I want to put into an array. How would I declare that?? Here is my code to accept the last measured value.
HTML
Dim measResult as string
For I as Integer = 1 to 4
measResult = objDevice.gpibRead(i, 30) ''30 is the buffer size
Next
How can I set up measResult so it is an array that will hold all of the measurements from the meter?? I have tried Dim measResult() as string, Dim measResult() as String = objDevice.gpibRead(1, 30) but no luck.
View 4 Replies
Mar 26, 2011
I need to declare dozens of objects (Textboxes and Checkboxes mostly) into differents arrays but when i try to do this, they are added as strings and not as objects. I'd like to add them as objects to run through them recursively.
[code]...
View 6 Replies
May 3, 2011
I'm trying to declare a array that I want to use in the module and in the forms. I like it to be usable all over but I cant get it to work.[code]...
View 3 Replies
Jan 29, 2009
I am looking to declare an array of 20 integers to store the answers to the questions, and then for the next button i am looking to get the answer and write it to the array. If one radio button is checked then i want it to write 1 to the array. Then finally i want to write the username, the array of answers and score to the txt file. How can I do that?
below is my code i have so far:
Imports System
Imports System.IO
Public Class Question
[Code].....
View 1 Replies
Apr 21, 2009
How would i declare an array which would eventually hold data as follows:
Arr = [ _
[ 0, 0, 0, 0, 0, 0, 0, 0], _
[ 0,101,101,101,101,101,101, 0], _
[Code].....
View 26 Replies
Dec 10, 2009
Public Function manyarrays(ByVal ParamArray ints() As Integer,ByVal strs() As String) End Function But it is error . How can i fix it ?
View 3 Replies
Dec 11, 2009
I am upgrading a project from VB6 to VB.NET. Unfortunately, I cannot include the DLL or even the name of the DLL that I am using here, I am under a confidentiality agreement. However, I hope I can post enough info here to get this frustrating problem solved.
In VB.net: Code:
So, if I run it as such, it errors out while calling SetParameters saying
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
If I comment out the line m_Parameters.SProperties = New S_Properties(9) {...}, then it does not error out, however the function returns 0, which means it did not actually set the parameters to the device. Trying to ReDim SParameters(9) will also give the hresult error. Doing it with my example above, I put a watch on m_Parameters in both VB6 and VB.net and they look IDENTICAL. All data is the same. Why would I get this ArgumentException in VB.NET and not in VB6 when I am passing in the exact same arguments as in VB6?
View 6 Replies
Feb 26, 2011
So I have an assignment dealing with arrays for school but first I will start it off with the simple question as to where I am stuck now. I was wondering what the simplest way is to declare all the numbers in an array without going down the list one by one ( ArrayA(1) = 1, ArrayA(2) = 3 and so on.) I was wondering if the simplest way to do this is just by putting: ArrayA = ArrayA += 1 or what the simplest way to do this is.
View 6 Replies
Jun 19, 2011
I have an array of people stored in a custom structure array... how can i copy this array to a temp array so that the temp array has all the same values as the original custom array?
View 4 Replies
Nov 23, 2009
give me example of how I would declare a base case for a 2d array in visual basic. I am using 2008 edition
View 19 Replies
Nov 2, 2010
I've been taking a class on it this semester and am starting to get very confused and behind. I've been pretty stuck on my hwk assignment for this week and was wondering if anyone could possibly hint at what I'm doing wrong or if I'm just completely way off. The whole rows and columns in arrays seems to be throwing me off now. Also, sorry if this is not the right place to post something like this I was not sure which section this fit under.
[Code]...
View 2 Replies
Jun 6, 2012
Im trying to query a game server, and have been looking up what to send and so on...This is what they say:Quote:Request formatServer info can be requested by sending the following byte values in a UDP packet to the server.
FF FF FF FF 54 53 6F 75 72 63 65 20 45 6E 67 69 TSource Engi
6E 65 20 51 75 65 72 79 00 ne Query
[code].....
View 3 Replies
Aug 5, 2009
I've tried different approaches to query a simple xml and compare one of it's values but none of them worked well.
Consider the following XML structure:
<?xml version="1.0" encoding="iso-8859-1" ?>
- <Shops>
- <Shop>
<text>Northampton</text>
<value>NN</value>
<currentdate>050809</currentdate>
<labelcounter>1</labelcounter>
[Code] .....
I have the shop name in a drop down list which is ShopsDDL and it's set to autopostback. What I want to achieve is:
On postback, check for a xml node where node's text = shopDDL shopname
And retrieve also this node's currentdate and label counter.
Rhen, if the node currentday = today then increment labelcounter by 1
Else set labelcounter = 1 and currentday= today
My problem is the XML query, I can do all the logic as soon as I manage to retrieve data from the XML.
View 1 Replies
May 24, 2011
Im just doing some tests to connect to a mysql database.I do not know how to call these values once I have made the sql query. How do I go about this, i.e. to show the values on the labels on a form?
Code:
Imports MySql.Data.MySqlClient
Public Class Form1
Dim ServerString As String = "Server = localhost; User Id = root; database = CALIBRA"
Dim SQLConnection As MySqlConnection = New MySqlConnection
[code]....
What do I put in the "SOMETHING MISSING HERE"?
View 1 Replies