Looking for a hosted bug/issue tracker? Try our hosted development tools.

Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1207
Number of posts: 2942

This Forum Only
Post New Thread

Report
For loop help VB6 Posted by daveronan on 24 Nov 2009 at 11:31 PM
Hi im stuck im trying to make a for next loop to output this in a pic box

2
2 4
2 4 6
2 4 6 8
2 4 6 8 10

I've got this far but it only outputs 4's

Dim linecount3 As Integer
Dim num As String
Dim numbercount As Integer

For linecount3 = 1 To 5
num = ""
For numbercount = 1 To linecount3
num = num & 2 + 2
Next
picBox1.Print num
Next

4
44
444
4444
44444

Can someone pls help me with this??
Report
Re: For loop help VB6 Posted by ethan1066 on 22 Jan 2010 at 12:32 AM
try this one
Dim linecount3 As Integer
Dim num As integer,num2 as integer

Dim numbercount As Integer

For linecount3 = 1 To 5
picBox1.Print
num = 2
For numbercount = 1 To linecount3
num2 = num * numbercount
picBox1.Print num2
Next

Next




 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.