473,575 Members | 3,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with loop please

4 New Member
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
  7.         number1 = Val(TextBox1.Text)
  8.         number2 = Val(TextBox2.Text)
  10.         multiplier = Val(TextBox3.Text)
  12.        Do Until multiplier > multiplier + 1
  14.            For i = number1 To number2
  16.                 answer = i * multiplier
  17.                ListBox1.Items.Add(i & " Times " & multiplier & " = " & answer)
  18.            Next i
  20.             multiplier = multiplier + 1
  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!

Jul 14 '09 #1
2 1452
4 New Member
I think i may have solved my problem..

The code on line 13 now reads:

Do Until Multiplyer > Val(Textbox3.Te xt)

It now gives me the desired result
Jul 15 '09 #2
236 New Member
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

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 to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
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>
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 to use, see example: Use JOptionPane to take inputs from the user and display the results. Example: -------- If the user enters Amount Due ...
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 enters points 3. Using sqrt( (x2-x1)^2 + (y2-y1)^2) ) It calculates the distance
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. Please follow the specifications for assignment 3 as described below otherwise points will be taken off. Input from a file Please create an input...
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 enter dice Values:
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 user sees all the colors listed on the page with hyperlinks that open the "mixes" page. The mixes page goes through each record, compares it with...
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, EmpName,DeptID,DateOfJoin, Sal, Addr) Finance (EmpID, Sal) Club (Clubname, EmpID, Fee, DateOfJoin) Leave (EmpID, Date) Department (DeptID, DeptName,...
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 /new_file/prob1.rec started. Please wait.... In while loop of request searching *** glibc detected *** ./a.out: free(): invalid next size (normal):...
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 statements, as it should, but then the rest of the code doesn't run. Could someone please help me? Thanks for your help! #include <stdio.h>
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.