|
-
Nov 7th, 2002, 04:18 AM
#1
Thread Starter
Lively Member
Need ur advise
Need your advise badly. Below code doesn't work. Any idea where I can resolve this??Any help is greatly appreciated
Private Sub cmdValidate_Click()
Const ForReading = 1, ForWriting = 2
Dim RawdataStr As String
Dim RawStream
Dim i
Dim CAT(1 To 10) As Integer
Dim AllTotal As Integer
Open "a:\text.txt" For Input As #1
Do Until EOF(1)
DoEvents
Line Input #1, RawdataStr
If InStr(RawdataStr, " 774 ") = 0 Then
'If 774 found on a line
'''''''''''How to make the below part simpler???''''''''''''''''''''''
CAT1 = Mid(RawdataStr, 25, 4) 'eg output = 0101
CAT2 = Mid(RawdataStr, 29, 4) '0000
CAT3 = Mid(RawdataStr, 33, 4) '1516
CAT4 = Mid(RawdataStr, 37, 4) '1771
CAT5 = Mid(RawdataStr, 41, 4) '9009
CAT6 = Mid(RawdataStr, 45, 4) '1111
CAT7 = Mid(RawdataStr, 49, 4) '1122
CAT8 = Mid(RawdataStr, 53, 4) '0000
CAT9 = Mid(RawdataStr, 57, 4) '0000
CAT10 = Mid(RawdataStr, 61, 4) '7878
''''''''''How to add all value from CAT1 to CAT 10??''''''''''''''''''
For i = 1 To 10
AllTotal = AllTotal + CAT(i)
Next i
MsgBox AllTotal & ": is the total amount"
End
End If
Loop
Close #1
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|