Set A Value For An Unlimited Array Of Integer?
Sep 3, 2011I want to define an unlimited array of integer and add values to it but I have some problems.
I'm using this code (for example):
Dim I() As Integer
I(1) = 1
I want to define an unlimited array of integer and add values to it but I have some problems.
I'm using this code (for example):
Dim I() As Integer
I(1) = 1
How i can convert this array to an UNLIMITED range array?
[Code]...
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.
How i can make an array with unlimited range in VB.NET and also get the number of variables containing?
I tryed:
Dim _items(,) As String
_items(0, 0) = "hy"
_items(0, 1) = "hello"
[Code].....
ive got some simple problem i cant understand how to solve.
str(1) is an array and integer(or double, tried both)
a(1) is an array and integer (or double, tried both)
a(1) = a(1) + 1
Label1.Text = str(1) + a
the big part is where i get: operator '+' is not defined for types 'integer' and '1-dimensional array of integer'.why do i get that message and what does it mean? how do i make the code do what i want?
I'm trying to create a linked list of an array of integers. Why is the following implicit conversion required?
When I run the code that contains that conversion, I get the following error.
As a real-time data acquisition user control data (a packet of an array of bytes) arrives every second, is converted into an integer array and inserted into a linked list.
The most recently arrived data is painted as coordinates on a grid at the right of a PictureBox using Graphics.DrawLine (pen,X1,Y1,X2,Y2).
The oldest data (arriving 120 seconds ago) will be drawn at the leftmost portion of the Picturebox.
Why a linked list rather than a list? To display 120 views of time sequence data, the draw routine the most recently inserted node to a node that points to Nothing. How do I limit the length of the linked list to 120 nodes and always ensure that the last node points to Nothing?
Do While Not item Is Nothing
item = item.NextItem
Loop
this is for a BINGO game final project that I already turned in but this just bugged me that I could not get the sorting figured out. I am trying to get this to sort the random numbers in to columns under the correct letters but I keep getting the error Operator '>=' is not defined for types '1-dimensional array of Integer' and 'Integer' under the line:
[Code]...
A c# class's single dimension byte array contains socket level instrument sensor data as per:
public static byte[] frameData
I'm having problems with marshaling in VB.NET to C++, here's the code :
In the C++ DLL :
struct APP_PARAM
{
[code].....
I am creating a dll with all the functions and subroutines that I use all the time and I decided to create a function that I can pass different types of array to so the function obviously (or not) would have an array of type object. Now I no you can pass any type into an object type but when I pass an integer array into an object array I get an error.
value of type '1-dimensional array of integer' cannot be converted to '1-dimensional array of object' because 'integer' is not a reference type.
Shared Function CompareArray(ByVal FirstArray() As Object, ByVal SecondArray() As Object, Optional ByRef ErrorMessage As String = "") As Boolean
Dim IntArrayOne() As Integer = {1,2,3,4,5} Dim IntArrayTwo() As Integer = {1,2,3,5,6} Dim IsSame As Boolean = False IsSame = CompareArray(IntArrayOne(), IntArrayTwo())
I currently Have an array ...
Dim mTeam(10) As String
In the Form load For visual basic i have
'Load Teams
mTeam(1) = "Oklahoma"
mTeam(2) = "USC"
mTeam(3) = "LSU"
[code]....
ButtonName (button to do all the work and show messagebox) i already have a try catch to have it only take integer values between 1 and 10.
I want to make a treeview where users can add information and folders in it.I managed to do code for an xml document so that the users can have up to 1 folder, but I want to have moreIs it possible to have an "unlimited" xml/treeview? Like in IE, Safari, Google Chrome, you can make unlimited folders and it will still save; how can I do that?
View 7 RepliesI want to make a treeview where users can add information and folders in it. I managed to do code for an xml document so that the users can have up to 1 folder, but I want to have more Is it possible to have an "unlimited" xml/treeview? Like in IE, Safari, Google Chrome, you can make unlimited folders and it will still save
View 3 RepliesI am trying to rebuilt the BOM system from an existing BOM application. The table i used was the existing table and cannot be modified as it is contain around 20000 of part no there.What i am going to achieve is the structure view of the BOM using the treeview control. I want it to have as many nodes as the BOM required which different from one to other part no.Here is the structure of the table.
id
model_no
parent_no
[code].....
I've a dynamic integer array to which I wish to add new values. I've looked elsewhere but couldn't find anything definitive.
Dim TeamIndex(), i As Integer
For i = 0 to 100
'TeamIndex(i).Add = <some value>
Next
i'm trying to have a message box show information from a map. granted i am quite new to VB, but i have a good amount of experience in php and some in java.
[code]...
I want a number like 1000 (hex 3E8) to be 232, 3.
View 2 RepliesI'm having trouble with this specific code and on arrays in general. This is what I am asked to do: "In this exercise, code an application that displays the number of students earning a specific score. Declare a 20-element, one-dimensional integer array named intScores with the following 20 numbers assigned to the array: (88, 72, 99, 20, 66, 95, 99, 100, 72, 88, 78, 45, 57, 89, 85, 78, 75, 88, 72, and 88). Code the procedure so that the user can enter a score from 0 to 100. Then the procedure should display using a message box the number of students who've earned that score."
First off, I do not know what I'm doing wrong with my array.. it says there's an error in line 31 saying "variable intSubscript hides a variable in an enclosing block" but I don't know what that means. And lastly, once that is sorted out, I don't know how to code a message box to appear saying how many students have received that score.
[Code]...
I am having trouble writing a loop that will check to see if a random number exists in an array.Let me Elaborate I have a function that returns a random (integer) number between a range called GetRandom()I want to execute GetRandom() and then check to see if MyArray() contains the new number, if it does not contain the number then I want to add it to the array, if it does contain the array then i need to run GetRandom() again until it doesn't contain the number.how to determine whether to throw the number out or add it to the array.
View 1 RepliesHow can i split a value and insert it into a array in VB?
An example:
The initial value is 987654321.
Using a for loop i need to insert the value as something like this:
Position(1) = 9 'The first number from the splited integer
Position(2) = 8 'The second number from the splited integer
first i need to input the expression in textbox that will be store to CharArray and then substitute the variables to integer by using input boxes.. my problem is how can store the integer to an array and also store the operation..
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim arr() As Char = TextBox1.Text.ToCharArray
[Code]....
I have unusual format of XML as below example
<mainmenu>
<menu caption="File">
<menuitem caption="New" tooltip="Create New File" shortcut="Ctrl-N" Action="New">
[code].....
How would you let the user of a program enter an unlimted amount of numbers ranging from 0-100, and then have the program tell the user the highest and lowest values from the data they entered?The user would enter the data in when they clicked a button, and the program would sort the data out when another button was clicked.
View 8 RepliesI am new to vb net so please cut me some slack if this is a stupid question, I have always used vb6 before, but finding that its less and less supported so trying to learn vb.net by myself. Also I am doing this for a hobby not a profession.I am writing an Console application to read a file sequentially 1 byte at a time into a 1 byte buffer. It then copies that byte into a 4 byte lookup buffer, that moves, ie as the file pointer moves forward by one byte the 4 byte lookup buffer copies the last 3 bytes into the first 3 bytes to accept the byte at the file pointer into the 4th byte of the lookup buffer. I am doing 1 byte at a time because the data I am looking for is not at pre-determind offsets and filesizes may not be a multiple of 4.
[Code]...
Help please its driving me mad It appears as if the byte is not being transferred to the lookup buffer so that it would always be 0, either that or I am not converting it to an integer properly
I am reading/writing a fixed length header into a stream and I need to do the following in VB:
1. Convert a 2 byte integer (int16) into a byte array
2. Read 2 bytes of a byte array into an integer variable
I have a very simple question about converting a byte array into 16bit integers. I am connected to a device through a serial port. It sent me six bytes which represent three Int16 integers. For example, the byte array is called newRecievedData(5) and has a length of 6.
The manual that came with the device claims that the int Format is 8 bit MSB|8 bit LSB. Does that mean the following?
newRecievedData(0) contains 8 high bits of the first Int16
newRecievedData(1) contains 8 low bits of the first Int16
newRecievedData(2) contains 8 high bits of the second Int16
[Code]....
but VB.NET Express 2008 gives me the error that Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'Short'.
i want to get a random number from an integer array, then delete that number in that array.for example, i have an array like this {1,2,3,4,5,6,7,8,9}now i want to get a RANDOM number in that array ( the number must be in the array), 8 for example. And then delete it from the array.
View 10 RepliesI have an array of integers and I need to know the index of the largest number (not the actual value, just the index of whichever is highest).
However, if one or more indexes "tie" for the highest value, I need to have all of the indexes that share that high value.
I assume this function would need to return an array (since it could be one or more indexes), but I am not totally sure how to go about getting the more efficient solution.
I'm trying to get my chart (y values) updated on the run, they need to be updated by an integer.
Dim a As Integer
Dim b As Integer
'some button.click code, contains a += 1 and b += 1
Chart1.Series("Series1").Points(0).YValues = a
Chart1.Series("Series1").Points(1).YValues = b
But it says Value of type 'Integer' cannot be converted to '1-dimensional array of Double'.
so, what do I have to do to fix this?
Apologies if this is the wrong forum (the other LINQ based ones didn't seem appropriate). I'm writing a very simple code crack game, a player enters FOUR numbers in a text box which are compared against the random number generated on form launch. Random number generator
[Code]...