Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

For loop help VB6

daveronandaveronan Member Posts: 2
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??

Comments

  • ethan1066ethan1066 Member Posts: 1
    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

Sign In or Register to comment.