Posted: 10:03pm 04 Nov 2015 |
Copy link to clipboard |
 Print this post |
|
How about this, then?
START:
year$ = Right$(Date$,3)
month$ = Mid$(Date$,3,3)
days$ = Left$(Date$,2)
day = Val(days$)
Open "paul.dat" For input As #1
Print "DAY/MONTH/YEAR:"
Print days$,month$,year$
Print "Searching for year...";
Do 'look through the data for the year eg: "015"
Line Input #1,year2$
If Mid$(year2$,2,3) = year$ Then
Print "(OK)"
Exit Do
EndIf
Loop
Print "Searching for month...";
Do
Line Input #1,month2$ 'look through the data for the month eg: -10
If Mid$(month2$,2,3) = month$ Then
Print "(OK)"
Exit Do
EndIf
Loop
Print "Searching for day...";
Do ' look through the data for the correct day
Line Input #1,day2$
If Mid$(day2$,2,1)="," Then
daze$="0"+day2$
Else
daze$=day2$
EndIf
If Mid$(daze$,1,2)=days$ Then
Print "(OK)"
Exit Do
EndIf
Loop
'At this point, we should be at the right place in the datafile
Print "Dataset found:"
Print daze$
X=1:Y=0
Dim VALUE(8)
Do
Do
BITE$=Mid$(daze$,X,1)
If BITE$="," Or X>75 Then Exit Do
DAT$=DAT$+BITE$
X=X+1
Loop
VALUE(Y)=Val(DAT$)
Y=Y+1:X=X+1:DAT$=""
If Y=9 Then Exit Do
Loop
For X=0 To 8
Print VALUE(X)
Next
End
For X=1 To 8
If Eof(#1)<>0 Then
Print "End of datafile!"
Exit For
EndIf
Line Input #1,L$
Print L$
Next
Print:Print "Done."
Close #1
End
Smoke makes things work. When the smoke gets out, it stops! |