473,386 Members | 1,842 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,386 software developers and data experts.

help with loop please

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.  Dim number1 As Integer
  2.          Dim number2 As Integer
  3.          Dim multiplier As Integer
  4.          Dim answer As Integer
  5.          Dim i As Integer
  6.  
  7.         number1 = Val(TextBox1.Text)
  8.         number2 = Val(TextBox2.Text)
  9.  
  10.         multiplier = Val(TextBox3.Text)
  11.  
  12.        Do Until multiplier > multiplier + 1
  13.  
  14.            For i = number1 To number2
  15.  
  16.                 answer = i * multiplier
  17.                ListBox1.Items.Add(i & " Times " & multiplier & " = " & answer)
  18.            Next i
  19.  
  20.             multiplier = multiplier + 1
  21.  
  22.        Loop

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 1445
I think i may have solved my problem..

The code on line 13 now reads:

Do Until Multiplyer > Val(Textbox3.Text)

It now gives me the desired result
Jul 15 '09 #2
smartchap
236 100+
Dear Steve
I think there is no need to use the Do Loop here.
Jul 16 '09 #3

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

Similar topics

23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
3
by: mslyman | last post by:
Hi, I could do with some help. I have this XML. <region> <region_code>567</region_code> <store> <store_code>345</store_code> <dept> <dept_code>32</dept_code> </dept>
1
by: Benton2862 | last post by:
I need help with and array for a program that acts like a cash register. The user will input an items price and then there payment. It will tell you the change and then tell you what kinda of change...
28
by: Nutkin | last post by:
Basicly i have to make a program that calculates the distance between x and y points in 2d space. the code basicly goes like this 1. User says how many points they have (max of 10) 2. User...
1
by: al2004 | last post by:
Write a program that reads information about youth soccer teams from a file, calculates the average score for each team and prints the averages in a neatly formatted table along with the team name....
1
by: ndawg123 | last post by:
Hey guys what im trying to do is write a yatzee game with C. And im stuck already and its the start?!?! I want the user to type there 5 numbers. i.e My program so far does this Please...
9
by: TF | last post by:
Hello all, I made a ASP.NET 2.0 site that shows possible "recipes" for paint colors stored in an access dbase. Basically, 1000 colors are stored with specific RGB values in separate columns. A...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
0
by: shrik | last post by:
I have following error : Total giant files in replay configuration file are : File name : /new_file/prob1.rec Given file /new_file/prob1.rec is successfully verified. Splitting for giant file...
3
by: gmdune | last post by:
Hi All, I have written a program that doesn't seem to work and I can't figure out why it's not working. It compiles correctly, but when I run it I get prompted by the first couple of printf...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.