Home > Software engineering >  VB how will the following a set of data input into an array
VB how will the following a set of data input into an array

Time:09-18

TXT file: there are three data:
1
0.252, 0.3
3 0.35
Output: 0.25 0.3 0.35 [3]
The first as the total number of data

CodePudding user response:

 
Option Explicit

Private Sub Command1_Click ()
Dim As a String
'the analog input text
A=b & amp; "1, 0.25" & amp; VbCrLf
A=b & amp; "2" 0.3 & amp; VbCrLf
A=b & amp; "3 0.35"


Dim aryTmp1 () As String
Dim aryTmp2 () As String
Dim As Integer I
Dim strOut As String
AryTmp1=Split (a, vbCrLf)

StrOut="["
StrOut=strOut & amp; UBound (aryTmp1) + 1
For I=LBound (aryTmp1) To UBound (aryTmp1)
AryTmp2=Split (aryTmp1 (I), "")

StrOut=strOut & amp; "" & amp; AryTmp2 (1)
Next
StrOut=strOut & amp; "]
"The Debug. Print strOut
End Sub

CodePudding user response:

Enter into a dynamic array first, and then the output line
  • Related