VS 2005 - Loop Starts In X Then Loops Through Y 20 Times Then Goes Back And Finishes X

Dec 6, 2010

The following loop starts in x then loops thru y 20 times then goes back and finishes x. how do I get it to loop thru x then complete loop y then loop x once more then loop y completely again 20 times then back to x and another 20 ys. there should be 200 loops today.

CODE:

I need to figure this out as part of a larger program.

View 1 Replies


ADVERTISEMENT

Loops - How Many Times Is The Loop Executed

May 6, 2009

[Code]...

how many times is the loop executed? what is the value of i after the code is executed? if x and y are dimensioned as dim x(10),y(10,2) as integer, what would happen in the code? what would happen in the code if the first statement was for i = 14 to 12 step 4?

View 2 Replies

Reset A Loop So The When It Loops It Goes Back To 0?

Apr 8, 2011

In the first loop once it cycles through once it does not reset the data so it continues to hold the previous data so therefore the outcome is incorrect. Can I reset it to start back at 0?

[Code]...

View 4 Replies

VS 2010 - Nested For Loops Seem To Only Trigger Once Instead Of The Number Of Times That Specified

Dec 7, 2011

I am trying to code something with nested for loop with the following format:

[CODE]...........

However when the program hits the last value of 'For loop 1', the nested for loops seem to only trigger once instead of the number of times that i specified.

Private Sub populatedgv1()
'setup temptable to store Server data
Dim m_table As New DataTable

[CODE]........................

View 7 Replies

KeyPress - Beep And Loops - Occur Multiple Times During The Execution Of A Program

Aug 10, 2011

I've written a keydown event that needs to occur multiple times during the execution of a program, and it needs to play a sound each time. The first time the keydown event is triggered, the sound plays without a hitch. However, the second time (and all subsequent times) the keydown event is triggered, a system beep accompanies the sound. I'm using Studio Express '10 and I've already integrated e.SuppressKeyPress into my code:

[Code]...

View 4 Replies

Using A For Loop And/or Nested For Loops?

Nov 4, 2011

how to create this sequence using a for loop and/or nested for loops?

1
2
3

[Code].....

View 2 Replies

Do A While Loop When It Loops Through The Items From A List

Jan 20, 2012

I am used to C# and just started vb.net. I am trying to do a while loop when it loops through the items from a list.

While oResponse.outputControl.Items(i) <> Nothing
//Do something
End While

View 2 Replies

Loops And Arrays - After The Loop Is Completed - Pull A Value From The Array And Display It?

Apr 15, 2012

i have a array set up, and i need the array to be global, but i can only get vb to accept it in a button, in addition, after the loop is completed, i am trying to pull a value from the array and display it but am getting an error.the code is as follows:

Public Class Form1
Friend staten As String
Friend statea As String[code].....

View 7 Replies

How To Display A Bitmap On Form, And Then Remove It At Times, And Put It Back Again

May 13, 2009

I want to display a bitmap on my form, and then remove it at times, and put it back again.
I have the Bitmap in my resources folder.in my form properties, it is selected as background image.

somewhere in my code I set the background image to = nothing (that makes it disappear) but every time I try to bring it back, I get file not found.I got it to display when I hard-coded the entire path and filename.[code..]

Obviously, when I publish and distribute to clients, the file won't be there.[code...]

View 1 Replies

Stop And Starts A Running Loop Of Number On A Text File Or Database In Visual Basic?

Aug 25, 2011

I need a small app that randomly shuffles a set of preloaded numbers. The shuffling will be visible on the screen and goes on continuously (looping) until a key is pressed and as soon as that happens it will show the winning number.Am using visual basics 2008 to develop the application but my problem is when i start the app and hit a key it will loop through my numbers on the text file and it will also display the event but if i hit a key to stop it will not stop..I was workin on the app but my problem is how to stop the loop and resume on the with a keypress. below is the app codes.

Dim Running As Boolean = False
Sub ReadAccounts()
Dim arr As New ArrayList
arr.Add("1366-665885-666-22650")[code]....

View 1 Replies

How Many Times Is The Loop Executed

May 6, 2009

i = 5, j = 15
do while (i<j)
i=i+1
j=j-1
end while

how many times is the loop executed? is this 4?

final value of i? 9?
final value of j? 10?

when would you do a do while versus a for next loop?if the upperbound of a one dimensional array is 10, what is the size of the array? 11?CAN I GET HELP WITH THIS

dim x(20,2), y(20,2) as integer
dim i as integer
for i = 4 to 12 step 4

[code]....

how many times is the loop executed? 3?what is the value of i after the code is executed?if x and y are dimensioned as dim x(10),y(10,2) as integer, what would happen in the code?

View 9 Replies

Run A Loop Multiple Times?

Sep 28, 2009

I read the lines from a textfile into a string array and then I use a foreach loop on the string array. I want to go through the same string array again after the loop reach the end of the string array

View 1 Replies

VS 2008 Very Different Times For The Same For Next Loop?

Sep 15, 2010

I have about 1.000 text files in a folder, and I wanto to make some statistics reading the files content.In the first place I store the files path + name in a MyFiles() array, then, when I press a "Start" button I read the several files:

For x As Integer = 0 To MyFiles.Length - 1
FileReader = My.Computer.FileSystem.ReadAllText(MyFiles(x))
(data processing)
(data processing)
next

then I have copied and pasted the first 500 files in a new folder and added to the code if x > 500 the stop The strange thing is this: to elaborate the 500 files of the second folder takes about 4 seconds, to elaborate the first 500 files of the first folder (THAT ARE IDENTICAL TO THE 500 FILES OF THE SECOND FOLDER) takes 7 seconds.The same identical code takes different times to elaborate the same identical files if they are stored in different folders with different files number.

View 2 Replies

Delay Of In Interval With The Loop Of 10 Times?

Jan 12, 2011

i want to do this with the delay of in interval with the loop of 10 times.

for n=0 to 10
label.text="0"
time delay of 1 second
label1.text="1"
end loop

But when i m using executing the loop completes it iterations and timer just show work in last iteration.

View 5 Replies

How To Loop InputBox Multiple Times

Feb 24, 2012

I'm trying to loop the inputbox 5 times but I'm not sure how.
Dim payroll1 As String
payroll1 = InputBox("What is the payrolls for store1", "Inc", , , )
Lblstore1.Text = payroll1
I can get it to loop till a specific amount but not 5 times exactly.

View 9 Replies

Loop 25 Times As Atm It Keeps On Going And Wont Stop?

May 19, 2011

i have been working on maths game program for college and have advanced to the part where i have random questions asked repeatedly.

i need it to loop 25 times as atm it keeps on going and wont stop. also i need it to count how many are right, and each question they answer they get 2 chances to get it right or the game ends.but i dont know how to do any of this. this is my code so far for the questions

[Code]...

View 7 Replies

Loop Words For A Number Of Times?

Feb 10, 2009

Is there a way to loop words for a number of times (like i want to loop a word for only 10 times....How would I go by doing that?)

Quote:

Originally Posted by EXample Like I want to have a textbox and If i put 10 in the textbox It would loop the word ten times or is I put 20 in the textbox it would loop 20 times ..and ..etc...and ...etc...

View 11 Replies

Random Number Of 6 (1 ,6), And To Loop It 3 Times?

Feb 16, 2009

I need a random number of 6 (1 ,6), and to loop it 3 times. I tried this but it gives me error for - if myRandom.next(1,6) Then:

Dim myRandom As Random()
For i As Integer = 1, 3
If myRandom.next(1, 6) Then
End If
Next

Also I need to know the code for putting a picture into a picture box.

View 4 Replies

VS 2005 Use Loops For Each Listview Items?

Jan 8, 2011

I have a problem with the loops, I am trying to read for every items in the listview1 and I am trying to find the matches for every listview items in str.contains variable and extract every field id of delete.php for each matches. I can only get one match for the listview item. I want to find each listview items in str.contains variable and find for each matches then extract for the field ids.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.Enabled = True Then

[Code].....

View 8 Replies

VS 2005 Counter Class Definition Loops?

Sep 14, 2009

I have 3 classes that need themselves in order to do their work but if I declare them the old way it would end up being an endless loop.

As an ex C++ programmer, I know I could use include once but I don't know if there is any equivalency in vb.net Here is the picture.

I have 3 Classes : SQLConnector, ErrorHandler, LogHandler

- ErrorHandler needs SQLConnector to get some IDs from the Database.

- ErrorHandler needs the LogHandler class to prepare the Logs to be... logged.

- SQLConnector needs the ErrorHandler class in case there is errors happening.

- LogHandler needs SQLConnector to insert in the database.

- LogHandler needs ErrorHandler in case the insert is not successful (sends mail in that case)

As you can see, all three classes are needed. The reason why I can't use LogHandler and ErrorHandler as one class is that I will use that class to log transactions and changes according to some parameters. Log is in no way exclusive to ErrorHandler.how I can prevent to make an endless loop and use all three of them as I wish?

View 11 Replies

Forms :: Choosing The Amount Of Times A Loop, Or Sub Should Occur

Mar 29, 2009

I have made an app that the user has to type a number, and i want the process for the app to do this how evermany times the user wishes it to do.

for example, the app is ment to create a line in a text document, so they write in textbox1 what they want written on the line, and then in textbox2, tey say how many lines they want to create.

So,

TextBox1.Text = "BLAA"
TextBox2.Text = "782"

It will create 782 lines of BLAA. not just one...

View 2 Replies

VS 2008 - Make A Loop From 1 To 100 And Make It Everytime It Loops Display Incrementing Numbers To The Screen?

Aug 23, 2009

How do I make a loop from 1 to 100 and make it everytime it loops display incrementing numbers to the screen?

View 1 Replies

Monthly Payment Calculation, For Loops To Do While Loops?

Oct 8, 2011

the purpose of the program is to display the monthly payments on the loan.My homework is to use do while loops instead of for loop.Here is the code for the for loop.

Option Explicit On
Option Strict On
Option Infer Off

[code].....

Now I'm having some trouble displaying the output using the do while loop, and I'm pretty sure it's a loop problem on my code. However, I cannot seemed to find out what's wrong. I looked at the examples of do while loop in my textbook, but I couldn't find anything useful to my problems of my program.This is the output for the do while loop.

Here's the do while loop code

Option Explicit On
Option Strict On
Option Infer Off

[code].....

View 3 Replies

VS 2005 - Form Resizing - Size Of Text Boxes Starts Decreasing

Mar 7, 2010

i have a button in my form which increases the font size of the form by 1. [Code] now when i increase the font size, after increasing by 3 the size of text boxes starts decreasing. this is how the form looks after size+5, when i open the form, the tabpage resize event is called 3 times.

View 1 Replies

Save Multiple Times By Doing A LOOP Depending On The Number Of Checked Checkboxes On A Datagridview .NET 2010?

Oct 11, 2011

I have a datagridview with checkboxes in the first column and I want to do a loop on saving the serialnumber(s) when the users decides to check a number of checkboxes Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

the problem with this code is that it only inserts the serial number of the LAST checked checkbox and the number of entries of it depends on the number of checked checkbox for example ... if I checked the rows with the serialnumber 123 and 55652341, first the row with the serial number 123 then second 55652341, only 55652341 appears in the database and it is entered twice(twice because two checkboxes are checked)

View 2 Replies

When Break Out Of Loop / Break All Nested Loops?

May 11, 2012

So I have some vb.net code, and I have a nested For loop inside a For loop, and then I have EXIT FOR statement, will it break out of one loop, or the whole chain?

View 2 Replies

VS 2008 Catch Exception Write To Log And Then Get Back Into Loop?

Aug 5, 2009

How do i catch the exception, write to log and then get back into the loop?[code]i want that app keeps running although an exception is thrown.

View 11 Replies

Work Out Conversion And Loop Back To Menu Options?

Oct 24, 2010

I have this code below that I called a Conversion Wizard Because it converts temperature, weight and currency. It works so far but I am stuck. I don't know how to apply the correct loops to it. For example, Do While and Do Until. I want it to be able to work out a conversion then loop back to the Menu-options. So that you can do as many conversions as you like and end when option 4 is selected.

Option Explicit On
Module ConversionWizard
Sub Main()
Dim userOption As Integer
Dim farenHeight As Integer
[Code] .....

View 4 Replies

Program Starts When Computer Starts?

Jul 16, 2010

I want to make that program starts when computer starts. I have no idea how to do that.

View 4 Replies

Contain Functions(They All Have For Loops) Don't Work In For Loops?

Mar 6, 2011

When I use a For loop in a For loop the Contains Statement dosen't work! Even my custom one! I even tested mine and it works 100% And neither that or the String.Contains function work inside of For Loops And, I know both of them use loops to search through a string.

My function(It will atleast search once):

Function RealContains(ByVal load As String, ByVal needle As String) As Boolean
load = load.ToLower

[CODE].....................

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved