|
-
Jan 23rd, 2002, 09:16 AM
#1
Thread Starter
Addicted Member
Using a Data file
Ok, how do i use a dat file? I want the dat file to collect the highest amount of "sales" in my project. I know i gotta use a Do while loop, but i'm not fulent with that. Basicly my Dat file looks like this:
Dailysales.dat
101
10.00
5.00
124.75
-1
102
32.50
67.00
4.95
-1
101
43.00
25.00
-1
103
27.75
34.65
2.00
-1
That it for the dat file, but 101 , 102 ,103 are ID numbers fro Joe,Mary and Ted.
Thanks for any help.
-
Jan 23rd, 2002, 09:28 AM
#2
Something like this:
VB Code:
Dim intFFN As Integer
Dim dblAmount As Double
Dim strBuffer As String
intFFN = FreeFile
Open "C:\Dailysales.dat" For Input As #intFFN
Do Until EOF(intFFN)
Line Input #intFFN, strBuffer
If dblAmount < CDbl(strBuffer) Then dblAmount = CDbl(strBuffer)
Loop
Close #intFFN
MsgBox "The highest amount is " & dblAmount
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
|