Results 1 to 5 of 5

Thread: [VB6] Do Without Loop

  1. #1

    Joined
    Dec 2011
    Posts
    843
    Pronouns
    she/her
    Userbars
    3
    Thanks
    313
    Thanked
    346/213
    DL/UL
    34/2
    Mentioned
    179 times
    Time Online
    1d 19h 11m
    Avg. Time Online
    N/A

    Question [VB6] Do Without Loop

    This is a bit more complicated then you may think, I mean do without loop? Just add do. Buuuut in this case I can not find this and I need this to work... sooo...

    Code:
    Thank you for the help... I don't want TNT changing anything on neopets so I am ridding of this code being public.
    Sorry for the mess, I attempted tabbing... I don't like it... hehe
    Last edited by Ashleys165; 01-22-2012 at 11:38 AM.

  2. #2

    Joined
    Dec 2011
    Posts
    488
    Thanks
    303
    Thanked
    559/263
    DL/UL
    13/4
    Mentioned
    34 times
    Time Online
    1h 58m
    Avg. Time Online
    N/A
    Code:
     Loop Until mynumber = 10
    I think should be

    Code:
    Do Until mynumber = 10

  3. The Following User Says Thank You to Miguel For This Useful Post:

    Ashleys165 (01-21-2012)

  4. #3

    Joined
    Dec 2011
    Posts
    77
    Userbars
    3
    Thanks
    3
    Thanked
    32/22
    DL/UL
    30/0
    Mentioned
    24 times
    Time Online
    18d 20h 37m
    Avg. Time Online
    6m
    If you indent your code properly it would be much easier to debug things like this.

  5. #4

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    Sorry it is hard to read this code (indent when you are in a loop, the indention shows what peice of code goes within which part of the loop) , but it looks like you are mixing the types of loop statements.
    When using Do until, you don't need a second loop statement.
    Code:
    Private Sub Command1_Click()
    Dim x As Integer
    x = 0
    Do
       Text1.Text = x
        x = x + 1
    Loop Until x = 10
    End Sub
    A do while statement requires the loop
    Code:
    Private Sub Command1_Click()
    Dim x As Integer
    x = 0
    Do While x < 10
        Text1.Text = x
        x = x + 1
    Loop
    End Sub
    It does not appear that you are incrementing your number inside the loop, I am also not sure why you are dimensiong variables in a loop.
    Last edited by Soredavide; 01-21-2012 at 07:20 PM.

  6. #5

    Joined
    Dec 2011
    Posts
    843
    Pronouns
    she/her
    Userbars
    3
    Thanks
    313
    Thanked
    346/213
    DL/UL
    34/2
    Mentioned
    179 times
    Time Online
    1d 19h 11m
    Avg. Time Online
    N/A
    Quote Originally Posted by Hexx View Post
    If you indent your code properly it would be much easier to debug things like this.
    I learned from Youtube.... they don't really teach how to indent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •