VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Split Array and Line Selection

by Spyo (2 Submissions)
Category: Complete Applications
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

The Split() Return a Array has a Few Hidding secrets, For VB6 only, Here is a quick simple code to explain and also the famous (what is the max array solution)... It Convert a TextBox into a Line by Line Array the match the TextBox Line Number

Rate Split Array and Line Selection


Option Explicit

' put this code in a form, add a 
RichTextBox1, Text1, and a Command1 Button for vb6 only

Private Sub Command1_Click()

Dim x As Integer, i As Integer

Dim Ray() As String

x = 0

RichTextBox1.Text = "Spyo Was Here, and got" & vbCrLf & "1: One Choice" & vbCrLf & "2: No Choice" & vbCrLf & "3: None of the Above" & vbCrLf & "4: All of the Above"

Ray() = Split(RichTextBox1.Text, "" & vbCrLf & "")

For i = 0 To UBound(Ray)

x = x + 1

Next i

RichTextBox1.Text = ""

x = x - 1

For i = 0 To x

RichTextBox1.Text = RichTextBox1.Text & Ray(i) & vbCrLf

Next i

Text1.Text = x & " Arrays As In Ray(0),Ray(1),Ray(2),Ray(3),Ray(4), but not Ray(5) or Above"

End Sub

'This is something very usefull, please improve it and share,,, vote ?

Download this snippet    Add to My Saved Code

Split Array and Line Selection Comments

No comments have been posted about Split Array and Line Selection. Why not be the first to post a comment about Split Array and Line Selection.

Post your comment

Subject:
Message:
0/1000 characters