Results 1 to 4 of 4

Thread: array

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    array

    I have this:

    VB Code:
    1. Print #1, lblName(i).Caption; ","; score(i).Caption; ","; kills(i).Caption; ","; death(i).Caption

    I need i to any number from 0-15 so instead of me doing

    Print #1, lblName(0).Caption; ","; score(0).Caption; ","; kills(0).Caption; ","; death(0).Caption
    Print #1, lblName(1).Caption; ","; score(1).Caption; ","; kills(1).Caption; ","; death(1).Caption

    and so on i can just use 1 line.

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: array

    VB Code:
    1. Dim i As Integer
    2. For i = 0 to 15
    3.     Print #1, lblName(i).Caption & "," & score(i).Caption & "," & kills(i).Caption & "," & death(i).Caption
    4. Next i

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: array

    Thanks, it works. Now how can I make it so instead of seperating with commas (,) it writes on a separate line. Basically equivalent of <br>

  4. #4
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    266

    Re: array

    use this

    For i = 0 to 15
    Print #1, lblName(i).Caption & vbCrLf & score(i).Caption & vbCrLf & kills(i).Caption & vbCrLf & death(i).Caption
    Next i

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