Split Array and Line Selection
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
Original Author: Spyo
Code
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 ?
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.