- 
	
	
		
			
			
				Contributing Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					How to print an array in Richtext box
				
				
						
							
							
						
						
				
					
						
							Hi All,
I want to print the elements of array in rich text box. And i want each element of array to be in new line.
so i achieved tat with this piece of code
In sub routine
        arr(0) = "Here"
        arr(1) = "Pencils"
        arr(2) = "String"
        RichTextBox1.Text = (arr(0) & vbCrLf & arr(1) & vbcrlf & arr(2))
But if there are 100 elements, it will be too lengthy.
So is there anyway that i can give the array address and it prints in new line.
Say like  RichTextBox1.Text = &arr
or put in a if loop .???
I tried it but could not make it,
Can anyone help me please....??

						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
- 
	
	
		
			
			
				Contributing Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					Re: How to print an array in Richtext box
				
				
						
						
				
					
						
							hey try to use varible and increment it.
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
- 
	
	
		
			
			
				Contributing Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					Re: How to print an array in Richtext box
				
				
						
						
				
					
						
							I tried like this
For i = 0 To 3
            RichTextBox1.Text = (arr(i) & vbCrLf)
            i = i + 1
  Next
But the values are overlapping
Mean only last array element is getting printed
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
- 
	
	
		
			
			
				Junior Member
			
			
			
			
				
					
						
					
				
			
			 
			
				
				
				
				
				
					    
				
			
		 
		
			
				
				
				
					Re: How to print an array in Richtext box
				
				
						
						
							
						
				
					
						
							hye just a small change in ur code reqd...
 
For i = 0 To 3
RichTextBox1.Text = RichTextBox1.Text & arr(i) & vbCrLf
i = i + 1
Next
						
					 
					
				 
			 
			
			
		 
	 
		
	
 
                                             
		
		
		
	
 
	
	
	
	
	
	
	
	
	
	
	
	
		
		
			
				
				Posting Permissions
			
			
				
	
		- You may not post new threads
 
		- You may not post replies
 
		- You may not post attachments
 
		- You may not edit your posts
 
		-  
 
	
	
	Forum Rules