CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Displaying Arrays In Text Box

    I have an array of ints which I need display in a text box how is this done ?


  2. #2
    Join Date
    Jun 1999
    Location
    virginia
    Posts
    16

    Re: Displaying Arrays In Text Box

    It depends on how you want it displayed. If you want it streight across then do this.
    text1.text=""
    for x = 0 to 10
    text1.text=text1.text & array(x) & " , "
    next x
    text1.text=left(text1.text,len(text1.text)-3) ' this get rid of the last " , "

    if you want it displayed vertically then use
    text1.text=""
    for x=1 to 10
    text1.text=text1.text & array(x) & vbCRLF
    next x

    if a multi array then use
    text1 text=""
    for x=0 to 10
    for y=0 to 10
    text1.text=text1.text & array(x,y) & " , "
    next y
    text1.text=left(text1.text,len(text1.text)-3) ' this gets rid of the last " , "
    text1.text=text1.text & vbCRLF
    next x

    Using the Str() function add a space in front of the variable you are printing. The "&" dose not..


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

Featured