Thread: Help with prog
View Single Post
Old Dec 6th, 2005, 11:44 AM   #4
haddow64
Newbie
 
Join Date: Dec 2005
Posts: 4
Rep Power: 0 haddow64 is on a distinguished road
Ok, I've solved that problem by myself, And I know have it almost fully working. But 2 problems left

1)My directory size (dir) is automactically rounded up (I'm using 4.8 it goes to 5) how can I stop this???

2)I need help getting the detalis of the fastest hard disk to print out below the details of all of the hard disks. (I'm using public function "get_max" to try and find it)

This is the code I'm now using

Option Explicit
Option Base 1
--------------------------------------------------------------------
Private Sub cmdCalc_Click()
Dim loops As Integer
Dim rate(5) As Integer
Dim drive(5) As String
Dim min, max As Integer
Dim dir As Single
Dim fast As Integer
Dim element As Integer
Dim time As Long

dir = InputBox("Please enter the size of the Directory being transferred")

For loops = 1 To 5
       drive(loops) = InputBox("Please enter then name of the drive")
       rate(loops) = get_details(100, 10000, "transfer rate")
       time = get_time(dir, rate(loops))
       picDisplay.Print Tab(15); "Name of HD"; Tab(40); "Transfer Rate"; Tab(65); "Directory Size"; Tab(80); "Transfer time"
       picDisplay.Print Tab(15); drive(loops); Tab(40); rate(loops); Tab(65); dir; Tab(80); time
Next

element = get_max(fast)
picDisplay.Print "The fastest hard disk is " & element
End Sub
---------------------------------------------------------------------
Public Function get_details(ByVal low, ByVal high, ByVal note) As Integer
get_details = InputBox("enter the " & note)
While get_details < low Or get_details > high
       get_details = InputBox("out of range, re-enter")
Wend
End Function
-----------------------------------------------------------------------
Public Function get_max(fast) As Integer
Dim fastest As Integer
Dim loops As Integer

fastest = fast(1)
get_max = 1

For loops = 2 To 5
       If fast(loops) > fastest Then
               fastest = fast(loops)
               get_max = loops
       End If
Next
End Function
------------------------------------------------------------------------------
Private Sub cmdEnd_Click()
Dim leave As Integer
leave = MsgBox("Are you sure you want to exit?", 36, "Exit?")
If leave = 6 Then
End
End If
End Sub
----------------------------------------------------------------------------
Public Function get_time(ByVal dir, ByVal rate)
get_time = dir * 8 * 1024 / rate
End Function

And help would really be appreciated
haddow64 is offline   Reply With Quote