Results 1 to 5 of 5

Thread: [VB6] Do Without Loop

  1. #1

    Join Date
    Dec 2011
    Posts
    832
    Pronoun(s)
    she/her
    Userbars
    3
    Thanks
    313
    Thanked 341 Times in 208 Posts
    Downloads
    34
    Uploads
    2
    Mentioned
    179 Post(s)
    Time Online
    1 d 18 h 26 m
    Avg. Time Online
    N/A
    Rep Power
    11

    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

    Join Date
    Dec 2011
    Posts
    489
    Userbars
    0
    Thanks
    303
    Thanked 555 Times in 260 Posts
    Downloads
    13
    Uploads
    4
    Mentioned
    34 Post(s)
    Time Online
    1 h 58 m
    Avg. Time Online
    N/A
    Rep Power
    0
    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

    Join Date
    Dec 2011
    Posts
    74
    Userbars
    3
    Thanks
    3
    Thanked 32 Times in 22 Posts
    Downloads
    30
    Uploads
    0
    Mentioned
    24 Post(s)
    Time Online
    18 d 20 h 37 m
    Avg. Time Online
    8 m
    Rep Power
    10
    If you indent your code properly it would be much easier to debug things like this.

  5. #4

    Join Date
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked 165 Times in 45 Posts
    Downloads
    14
    Uploads
    9
    Mentioned
    68 Post(s)
    Time Online
    6 d 17 h 26 m
    Avg. Time Online
    2 m
    Rep Power
    11
    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

    Join Date
    Dec 2011
    Posts
    832
    Pronoun(s)
    she/her
    Userbars
    3
    Thanks
    313
    Thanked 341 Times in 208 Posts
    Downloads
    34
    Uploads
    2
    Mentioned
    179 Post(s)
    Time Online
    1 d 18 h 26 m
    Avg. Time Online
    N/A
    Rep Power
    11
    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
  •