- Код: Выделить всё
Dim Mfile() As String
Dim MfileLen() As Integer
Dim arrVal As Long
Dim temparrval As Long
Dim temp As String
Dim TempArr() As String
Dim OnExitArr() As String
Private Sub Form_Load()
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, q
arrVal = arrVal + 1
Loop
Close #1
ReDim Mfile(1 To arrVal)
ReDim MfileLen(1 To arrVal)
ReDim OnExitArr(1 To arrVal)
temparrval = 1
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, txt
Mfile(temparrval) = txt
temparrval = temparrval + 1
Loop
Close #1
For q = 1 To arrVal
MfileLen(q) = Len(Mfile(q))
Next
For q = 1 To arrVal
ReDim TempArr(1 To MfileLen(q))
For w = 1 To MfileLen(q)
TempArr(w) = Asc(Mid(Mfile(q), w, 1))
If TempArr(w) < 32 Then Exit Sub
If TempArr(w) > 250 Then
TempArr(w) = TempArr(w)
End If
TempArr(w) = TempArr(w) + 5
OnExitArr(q) = OnExitArr(q) & Chr(TempArr(w))
Next
Next
For r = 1 To arrVal
ss = ss & OnExitArr(r) & vbCrLf
Next
MsgBox ss
End Sub
и код котрый легко прочитать
- Код: Выделить всё
Dim Mfile() As String: Dim MfileLen() As _
Integer: Dim arrVal As Long: Dim temparrval _
As Long: Dim temp As String: Dim TempArr() _
As String: Dim OnExitArr() As String
Private Sub Form_Load(): Open "c:\1.txt" _
For Input As #1: Do Until EOF(1): Line Input _
#1, q: arrVal = arrVal + 1: Loop: Close #1: _
ReDim Mfile(1 To arrVal): ReDim MfileLen(1 _
To arrVal): ReDim OnExitArr(1 To arrVal): _
temparrval = 1: Open "c:\1.txt" For Input _
As #1: Do Until EOF(1): Line Input #1, txt: _
Mfile(temparrval) = txt: temparrval = temparrval _
+ 1: Loop: Close #1: For q = 1 To arrVal: _
MfileLen(q) = Len(Mfile(q)): Next: For q = 1 _
To arrVal: ReDim TempArr(1 To MfileLen(q))
For w = 1 To MfileLen(q): TempArr(w) = _
Asc(Mid(Mfile(q), w, 1)): If TempArr(w) < 32 _
Then Exit Sub
If TempArr(w) > 250 Then: TempArr(w) = TempArr(w)
End If: TempArr(w) = TempArr(w) + 5: OnExitArr(q) _
= OnExitArr(q) & Chr(TempArr(w))
Next: Next: For r = 1 To arrVal: ss = ss & _
OnExitArr(r) & vbCrLf: Next: MsgBox ss: End Sub
Код вполне рабочий и даже компилируется, я просто одному знакомому его так давал, он сильно кричал что прочитает любой код и поймет смысл с первого раза, но это уже отдельня история
Хотелось узнать может кто действительно так пишет?