    

Sub CmdReturn_Click ()
    Unload FrmChart
    Unload FrmWaiting
    FrmMain.Show
End Sub

Sub Form_Load ()
    Dim Length As Long
    Dim ReturnValue As Double
    Dim I As Integer
    Static Label(8) As String

    Graph1.FontUse = 4
    Graph1.FontFamily = 1
    Graph1.FontSize = 500
    Graph1.FontStyle = 2
    Graph1.LeftTitle = "Execution Time (Seconds)"
    
    Ratio.FontUse = 4
    Ratio.FontFamily = 1
    Ratio.FontSize = 500
    Ratio.FontStyle = 2

    If IntOrFloat = "int" Then
        Graph1.NumPoints = 5
        Label(1) = "Fibonnaci"
        Label(2) = "Sieve"
        Label(3) = "Sort"
        Label(4) = "Dhrystone"
        Label(5) = "Total"
    Else 'IntorFloat = 'flt'
        Graph1.NumPoints = 8
        Label(1) = "Float"
        Label(2) = "flt"
        Label(3) = "Savage"
        Label(4) = "Autodesk"
        Label(5) = "Autodesk (INTRIG)"
        Label(6) = "Whetstone (single)"
        Label(7) = "Whetstone (double)"
        Label(8) = "Total"
    End If

    For ThisAp = 1 To 2
        DosAp(ThisAp).Name = "c:\tnt\examples\bench\" & IntOrFloat & DosAp(ThisAp).Compiler
'        retcode = LoadDosAp(DosAp(ThisAp).Name, DosAp(ThisAp).Handle, SW_HIDE, 1024)
        retcode = LoadDosAp(DosAp(ThisAp).Name, DosAp(ThisAp).Handle, SW_SHOWMINIMIZED, 1024)
        If (retcode <> 0) Then
            ErrorMessage (retcode)
            Unload FrmMain
            End
        End If
        Graph1.ThisSet = ThisAp
        Graph1.LegendText = DosAp(ThisAp).Axis
        ReturnValue = 0#

        For I = 1 To Graph1.NumPoints
'            retcode = SendToDos(DosAp(ThisAp).Handle, ReturnValue, Len(ReturnValue))
 '           If (retcode <> 0) Then
  '              ErrorMessage (retcode)
   '         End If
            retcode = GetFromDos(DosAp(ThisAp).Handle, ReturnValue, Len(ReturnValue), Length)
            If (retcode <> 0) Or (Length > Len(ReturnValue)) Then
                ErrorMessage (retcode)
            End If
            Graph1.ThisPoint = I
            Graph1.GraphData = ReturnValue
            Graph1.ColorData = ChartColor(ThisAp)
            Graph1.LabelText = Label(I)
        Next
    
        Ratio.ThisPoint = ThisAp
        Ratio.ColorData = ChartColor(ThisAp)
    '    retcode = SendToDos(DosAp(ThisAp).Handle, ReturnValue, Len(ReturnValue))
     '   If (retcode <> 0) Then
      '      ErrorMessage (retcode)
       ' End If
        retcode = GetFromDos(DosAp(ThisAp).Handle, ReturnValue, Len(ReturnValue), Length)
        If (retcode <> 0) Or (Length > Len(ReturnValue)) Then
            ErrorMessage (retcode)
        End If
        Ratio.GraphData = ReturnValue
        Ratio.LabelText = ""
    
        Graph1.DrawMode = 2
        Ratio.DrawMode = 2
        FrmChart.Show
        FrmChart.Refresh

        retcode = UnloadDosAp(DosAp(ThisAp).Handle, ReturnValue, Len(ReturnValue))
        If (retcode <> 0) Then
            ErrorMessage (retcode)
        End If

        If ThisAp = 1 Then
            BuildMessage (2)
            FrmWaiting.Show
            FrmWaiting.Refresh
        End If

    Next
    CmdReturn.Enabled = True
End Sub

