Function lines(txtpath As String, ByVal startline As Integer, linenum As Integer) As String '显示 txtpath 文件的从startline 行开始的 linenum 行的内容
lines = \"\"
Dim filetxt As String, x As Variant, i As filetxt = String(FileLen(txtpath), \" \")
Open txtpath For Binary As 1
Get #1, , filetxt
Close 1
x = Split(filetxt, vbCrLf)
msgbox ubound(x)+1 '行数
If startline > UBound(x) Then MsgBox \"err!\": Exit Function
If startline <= UBound(x) Then
If startline + linenum <= UBound(x) Then Integer \"行溢出\
,
For i = startline To startline + linenum - 1
lines = lines & x(i) & \" \"
Next
Else
For i = startline lines = lines & Next
End If: End If
End Function
To UBound(x)
x(i) & \" \"