Type inrec
거래번호 As String * 6
제품번호 As String * 2
제품구분 As String * 1
거래처번호 As String * 6
거래처등급 As String * 1
단가 As String * 5
판매량 As String * 3
이익포인트 As String * 3
판매구분 As String * 1
담당이메일 As String * 4
배달거리 As String * 3
End Type
Dim outrec As inrec
Sub main()
Open "c:\c_it\data\abc0125.txt" For Random As #1 Len = Len(outrec) + 2
Open "c:\c_it\data\ans1.txt" For Output As #2
a = Val(Left(Command, InStr(Command, " ")))
b = Val(Mid(Command, InStr(Command, " ")))
Max = 0
For i = a To b
Get #1, i, outrec
sik = Val(outrec.단가) * Val(outrec.판매량)
If sik > Max Then
Max = sik
out = outrec.거래번호
ElseIf sik = Max And outrec.거래번호 < out Then
out = outrec.거래번호
End If