473,397 Members | 2,068 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,397 software developers and data experts.

looping help

i need help!

I'm currently trying to teach myself VB and its going good so far until the Do loops... i have an exercise that i can't seem to complete as i don't know the correct syntax to use can any one help?

the code is as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim number1 As Integer
  3.         Dim number2 As Integer
  4.         Dim multiplier As Integer
  5.         Dim answer As Integer
  6.         Dim i As Integer
  7.  
  8.         number1 = Val(TextBox1.Text)
  9.         number2 = Val(TextBox2.Text)
  10.  
  11.         multiplier = Val(TextBox3.Text)
  12.  
  13.         Do Until multiplier > multiplier + 1
  14.  
  15.             For i = number1 To number2
  16.  
  17.                 answer = i * multiplier
  18.                 ListBox1.Items.Add(i & " Times " & multiplier & " = " & answer)
  19.             Next i
  20.  
  21.             multiplier = multiplier + 1
  22.  
  23.         Loop
  24.  
  25.  
But i need to know what to put in the "Do Until multiplyer...." part to make it stop when the multiplyer is at the number the user types in!

anyhelp??
Jul 14 '09 #1
2 1158
i think i have solved it anyway...

the code on line 13 now reads:

Do Until multiplier > Val(Textbox3.Text)

Which gives me the desired result
Jul 15 '09 #2
MrMancunian
569 Expert 512MB
Hi,

Good work on solving this yourself! If you want to teach yourself programming, I can recommend the MSDN pages. The samples are most of the time sufficient to learn new code etc.

Good luck!

Steven
Jul 15 '09 #3

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

Similar topics

2
by: ensnare | last post by:
Hi all, I'm using a database session handler and am looking to loop through data residing in the sessions table to make a 'Users online' array. I've found that using urldecode on the data...
11
by: Dacuna | last post by:
Is it possible to use a recursive function to loop through a recordset faster? I have a table that I need to edit its contents after doing some calculation. The table has one field has an RawData...
7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
5
by: Jeff | last post by:
Hey gang. I have a script that gets stats from a mssql db, and then inserts those stats into a temp table. where i can work with them as i wish. the problem is it isn't looping through all the...
6
by: Luke - eat.lemons | last post by:
Hi, Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If...
3
by: Luke - eat.lemons | last post by:
Sorry for the post in this NG but im short on time to get this working and i haven't seem to of got a response anywhere else. Im pretty new to asp so all light on this question would be great. ...
7
by: jwatson | last post by:
hey guys need help or some guidances please. Basically its a complicated looping and relational question. Write a program to calculate te percentage score of the mark of the students.The program...
20
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1...
2
by: Davaa | last post by:
Dear all, I am a student making a MS Form application in C++. I would ask a question about "Timer". Sample code which I am developing is below. private: System::Void...
3
by: chiku1523 | last post by:
Hi, Please find the following code. In function setAnswers, I am looping with each question. I have inner loop, which is looping for each answers of the questions. If any of the answer for question...
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: 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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.