Results 1 to 6 of 6

Thread: need help for-next statement

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2021
    Posts
    1

    Question need help for-next statement

    so i just started visual basic and got stuck on for-next statement.

    I have:
    Name:  unknown.jpg
Views: 77
Size:  10.7 KB

    what should i do so my output will go like this:
    Name:  unknown.png
Views: 76
Size:  3.4 KB

  2. #2
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,419

    Re: need help for-next statement


  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,462

    Re: need help for-next statement

    Another option could be to use a string and the Left$() function
    above the loop
    Code:
    MyString="ABCDEFGH"
    in the loop
    Code:
    Print Left$(MyString,i)
    no need for the inner loop in this case

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    33,341

    Re: need help for-next statement

    Quote Originally Posted by DataMiser View Post
    Another option could be to use a string and the Left$() function
    above the loop
    Code:
    MyString="ABCDEFGH"
    in the loop
    Code:
    Print Left$(MyString,i)
    no need for the inner loop in this case
    Depends on what the lesson of the day is... Most of the time I've seen this kind of exercise, it's in dealing with multiple loops. It's often followed by trying to display a balanced Christmas tree.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,155

    Re: need help for-next statement

    It's amusing to see anyone recommend the obsolete Chr$() function. It was long ago replaced by ChrW$() when 16-bit VB was left behind in 1995.

  6. #6
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,419

    Re: need help for-next statement

    if u have nothing to contribute why u post garbage like that dilettante. if u have issue in your real life, please keep it out from here.

    its not replaced at all. u have chr, chrB and chrW, all 3 valid functions that can still be used. Im amazed that an expert like you dont know that.

Posting Permissions

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



Click Here to Expand Forum to Full Width