Loop Never Ends - 8 X 8 Array Of Integers (TheConnectionsValue (7,7))?
Jun 12, 2010
I am dealing with a situation which I do not understand why the loop never ends. I have attached this example. I do not know what I am doing wrong.I have 8 x 8 array of integers (TheConnectionsValue (7,7))
0
0
1
0
0[code]....
View 8 Replies
ADVERTISEMENT
May 25, 2010
I'm slowly learning about loops. I have a couple of questions
1) When a condition is being tested.. what does that mean? I don't understand the "condition" word.
2) What is the difference between a loop that never ends and a loop that ends?
I have the code for the loop that ends and the loop that never ends. I can see the difference in the code, but I don't understand what is making it different. Here is the code below.
[code]...
View 1 Replies
Feb 2, 2012
Basically I have and array of integers that vary in size. I need to compare each number to each other number and display which number is repeated. For example:
Dim ints() As Integer = {1,2,2,5,4,6}
The number that shows up more than once is 2.
How can I run through the array and compare each integer with the numbers in the array. I tried a for loop but it didn't return the value I was looking for.
View 3 Replies
Apr 8, 2010
Id like to use 4 integers in a For, Next loop. The integers are 1, 3, 7, 9. Is it possible to pass just these integers to the loop without putting them in an array or something similar?
[Code]...
View 20 Replies
Jul 30, 2009
I currently have a grid of 30 buttons, (6 x 5). So I named them btn1_1 - btn6_5
When the board loads up (this is for a jeopardy game) I have this
code
For counter = 0 To 5
Btn1_#.text = counter * 200
Next
Is there ANY possible way to do that (replace # with the number of the counter.) I doubt there is, but it never hurts to ask!
As a side note, where is a good place to post the jeopardy game that I am making in these forums, i tried both the code bank and gaming forums but they are dreadfully inactive.... since it is in VB.NET, i was wondering if i could post it here.
It is still in the making, but I would really like some feedback as i worked hard on it and got stuck for 6 hours on the save/load feature that was getting messed up cuz of a difference from A and a lol.
View 18 Replies
Aug 1, 2011
I tried adding a loop inside this loop but continue to get the error "Null reference exception was unhandled" before the loop ends.
For rowIndex = 0 To dgvVisit.RowCount - 2
MessageBox.Show(dgvVisit.Rows(rowIndex).Cells("CoPayCharge").Value.ToString)
For rowIndex1 = 0 To dgvPayment.RowCount - 2
MessageBox.Show(dgvPayment.Rows(rowIndex).Cells("CoPayPaid").Value.ToString)
Next
Next
View 1 Replies
May 8, 2011
Im currently making a tower defense game and im on my last bug for the game and i cannot get it solved. For some reason my For Loop to check if a shot hits a person is not working properly. Ill set it to "For Me.x = 1 To NumOfFaces 'Const for 5' and itll only check the first enemy and last enemy. Here is the code to check for if a shot hits an enemy, this runs on a timer through out the game.
Private Sub HitFace()
For Me.x = 1 To NumOfFaces
If Shot1Firing = True Or Shot2Firing = True Or Shot3Firing = True Or Shot4Firing = True Or Shot5Firing = True Or Shot6Firing = True Then[code].....
View 7 Replies
May 6, 2010
how to convert an array of strings to an array of integers? I want to convert a string array with 77, all string numbers, to an integer array?
View 1 Replies
Mar 26, 2012
I would like to loop through a number of integers to display the higher number, I would not know the higher or the lower number. How could I compare them to pick the higher one.
View 9 Replies
Dec 4, 2009
I have a quiz I am building that randomly picks the questions from the database and displays them to the page. It seems like it might be hanging with the logic I have on the page_load.I am storing the questionid in a session comma delimited and keep looping through to get the next randomly generated number that isn't in the session. [code]
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
Mar 30, 2011
how to write a function in VB that returns the smallest value in an array of integers?
View 2 Replies
Apr 10, 2012
What is the fastest way to convert a String into an array of Short integers representing the character codes?[code]...
View 2 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
Mar 10, 2010
I try to generate 10 random integers and store it in an array(9). Then I split the array into half by converting it into string. My code can compile but it sometimes work and most time cannot work. I don't know what is the problem....
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]......
View 1 Replies
May 17, 2012
Basically what I'm trying to do is this, I have 20 statements in a Select Case (right now they're just labels for my own testing), I have a random number generator that will generate a number between 1 and 20. Since I don't want the same statement to repeat during the individual run of the program I'm trying to generate a random number, then check it in a dupeCheck method, then if it isn't a dupe I'm trying to return it to the select case and put it in the array so that when I choose the next random number if it's the same the dupe check method will catch it and return a False boolean and then the random method will do a recursive call to itself to generate a new random number and the whole thing starts again. I'm populating the numbers into the select case just fine, but VB keeps telling me that my functions aren't returning values on all paths, and stepping through I can see that the recursion isn't happening and that it's just sending the repeat number back, but I can't figure out where my major issue is. I'll show you my current skeleton code for the "GuessOrDie" as well as the first manifestation of the code I wrote for it a couple of days ago (the old code had infinite recursive calls and array out of bound exceptions)
I would really love it if you guys could take a look and let me know what mistakes I'm making, I'm having big problems moving from FOR loops in java to For/Each loops in VB and I suspect that is a big part of my problem.
Current Code:
Public Class GuessOrDie
Dim questHistoryArray(19) As Integer
Dim indexCount As Integer
[Code].....
View 4 Replies
Sep 1, 2011
Am new to programming and i would like your help to this question. [b][color="Red"]Write a declaration statement of an array of integers to store 15 numbers. Initialise the first 5 values.
When I open the Visual Studio 2005 I don't see the template i.e. Win32 Applications, C++
View 11 Replies
Apr 13, 2010
"Create an array to store 10 integers. Initialize all the array elements with -1."
View 1 Replies
Feb 16, 2012
I have a form with a lot of LineShapes on it, and basically what I'm trying to do is make certain lines a blue colour and others a black colour, depending what it's in an array of integers. Each line is called line1, line2 etc. So if one of the values in the array is 3, then line3 would be coloured blue.
I have the following code to handle all the lines more easier:
MeterArray = New PowerPacks.LineShape() {line1, line2, line3, line4, line5}
However, since I'm going to have about 50 seperate lines, this is going to look quite messy when I reach line50. So my question is, is there a tidyier way of handling these lineshapes.
View 3 Replies
Feb 15, 2010
What is the simplest/best practices way to get a comma separated list of the integers in the Integer array levels?
Dim levels(5) As Integer
Dim levelsStr As String
'put values in levels'
[code].....
View 2 Replies
Mar 20, 2010
I tried coding for an application that will display the positive integers, negative integers and zero entered in a inputBox. for some reason it keeps crashing down.here is my code. paging all visual basic professionals. [code]
View 6 Replies
Apr 4, 2011
How would I create a list of elements in VB.NET, save it to a .dat file, and make Ruby re-create such list (as an array) with such elements (they will be strings, booleans and integers)?
View 2 Replies
Mar 31, 2012
I have been tasked to create a Visual Basic console script that asks the user 5 times in a row to input a number into an array (sales figures in thousands), Then you display these results as a sort of tally chart.
For example for the data: sales(10,7,12,5,15)
The output would be
2008:++++++++++
2009:+++++++
2010:++++++++++++
[Code]...
how to change the integer value from within the array into a certain number of a single character.
View 2 Replies
Mar 15, 2012
i want to see if i can get my hands on a working example of a 2d array something along the lines of continents and 5 sample countries from each continent.i would also like to know how to loop through a 2d array - i know i need a loop inside a loop but cant find any examples.i know to declare a 2d array its like: dim arrayName(,) = {{"sample","sample"}{"sample2","sample2"}}
View 1 Replies
Feb 26, 2011
I am designing a prisoner system
On the design i have different text boxes that display the prisoner name, birth date, number etc.
I then set all of the the different prisoners up in an array.
I want to know how to loop though this array so that when i start the program up it will start at the beginning of the array with the first prisoners details and then when i click "Next" the next prisoners details will be displayed in all of the boxes.
View 9 Replies
Apr 29, 2012
I am trying to display payment details for each loan, but I am having problems displaying on the form.
Public Class MortgageDetailsCalculatorForm
Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
[Code]......
View 2 Replies
Nov 3, 2011
I had insert value from datagridview to array
but how to make the array become for loop function?
Dim rowNo As Integer = 0
counter = dgv.RowCount()
[code].....
View 5 Replies
Oct 14, 2011
I'm writing a loop to go through the first array of a 2D loop, and I currently have it like this:
For Each Dir_path In MasterIndex(, 0)
'do some stuff here
Next
But it's giving me an error, saying it expects an expression in the first field. But that's what I'm trying to do, loop through the first field. How do I fix this? What would I put in there?
EDIT: to clarify, I'm specifically looking for the 0th element in the subarray of each array, that's why that second field is constantly 0.
View 2 Replies
Feb 13, 2012
I define a arrary.
Dim myStr(100) as string.
Then the length of this array is still 0. Then is risky to cross the bound. So how to intialize this array without using a loop?
View 9 Replies
Mar 10, 2009
I've been looking far and wide to find the answer to my question. Its probably has a simple answer, but I am new to VB2008 and can't figure it out. I have a web form setup 30 textboxes, and am trying to find a way to quickly add them to an array through a loop.Their ID's are all - TextBox1,TextBox2 ect. I have this loop here that runs with no errors, but nothing shows up in the TextBox's on the web form.If the TextBoxes are already on the form, do I still need to declare new boxes when trying to add them to the array? [code]...
View 4 Replies