home *** CD-ROM | disk | FTP | other *** search
/ BUG 11 / BUGCD1998_02.ISO / util / time2win / t2w32500.exe / _IEEENUM.FRM < prev    next >
Text File  |  1997-12-25  |  13KB  |  492 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmIeeenum 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Ieeenum"
  6.    ClientHeight    =   4845
  7.    ClientLeft      =   1890
  8.    ClientTop       =   3270
  9.    ClientWidth     =   7485
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Begin Threed.SSPanel SSPanel1 
  17.       Align           =   1  'Align Top
  18.       Height          =   480
  19.       Left            =   0
  20.       TabIndex        =   1
  21.       Top             =   0
  22.       Width           =   7485
  23.       _Version        =   65536
  24.       _ExtentX        =   13203
  25.       _ExtentY        =   847
  26.       _StockProps     =   15
  27.       ForeColor       =   -2147483640
  28.       BackColor       =   12632256
  29.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  30.          Name            =   "MS Sans Serif"
  31.          Size            =   8.25
  32.          Charset         =   0
  33.          Weight          =   400
  34.          Underline       =   0   'False
  35.          Italic          =   0   'False
  36.          Strikethrough   =   0   'False
  37.       EndProperty
  38.       Begin VB.ComboBox cmb_Function 
  39.          Height          =   315
  40.          Left            =   1365
  41.          TabIndex        =   2
  42.          Top             =   90
  43.          Width           =   4785
  44.       End
  45.       Begin Threed.SSCommand cmdNP 
  46.          Height          =   300
  47.          Index           =   1
  48.          Left            =   7140
  49.          TabIndex        =   6
  50.          Top             =   90
  51.          Width           =   255
  52.          _Version        =   65536
  53.          _ExtentX        =   450
  54.          _ExtentY        =   529
  55.          _StockProps     =   78
  56.          Caption         =   ">"
  57.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  58.             Name            =   "MS Sans Serif"
  59.             Size            =   8.25
  60.             Charset         =   0
  61.             Weight          =   400
  62.             Underline       =   0   'False
  63.             Italic          =   0   'False
  64.             Strikethrough   =   0   'False
  65.          EndProperty
  66.          BevelWidth      =   1
  67.          Font3D          =   3
  68.          RoundedCorners  =   0   'False
  69.          Outline         =   0   'False
  70.       End
  71.       Begin Threed.SSCommand cmdNP 
  72.          Height          =   300
  73.          Index           =   0
  74.          Left            =   6300
  75.          TabIndex        =   5
  76.          Top             =   90
  77.          Width           =   255
  78.          _Version        =   65536
  79.          _ExtentX        =   450
  80.          _ExtentY        =   529
  81.          _StockProps     =   78
  82.          Caption         =   "<"
  83.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  84.             Name            =   "MS Sans Serif"
  85.             Size            =   8.25
  86.             Charset         =   0
  87.             Weight          =   400
  88.             Underline       =   0   'False
  89.             Italic          =   0   'False
  90.             Strikethrough   =   0   'False
  91.          EndProperty
  92.          BevelWidth      =   1
  93.          Font3D          =   3
  94.          RoundedCorners  =   0   'False
  95.          Outline         =   0   'False
  96.       End
  97.       Begin Threed.SSCommand SSCommand1 
  98.          Default         =   -1  'True
  99.          Height          =   300
  100.          Left            =   6615
  101.          TabIndex        =   3
  102.          Top             =   90
  103.          Width           =   465
  104.          _Version        =   65536
  105.          _ExtentX        =   820
  106.          _ExtentY        =   529
  107.          _StockProps     =   78
  108.          Caption         =   "&Go"
  109.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  110.             Name            =   "MS Sans Serif"
  111.             Size            =   8.25
  112.             Charset         =   0
  113.             Weight          =   400
  114.             Underline       =   0   'False
  115.             Italic          =   0   'False
  116.             Strikethrough   =   0   'False
  117.          EndProperty
  118.          BevelWidth      =   1
  119.          RoundedCorners  =   0   'False
  120.          Outline         =   0   'False
  121.       End
  122.       Begin VB.Label Label2 
  123.          Caption         =   "&Select a function"
  124.          Height          =   255
  125.          Left            =   90
  126.          TabIndex        =   4
  127.          Top             =   120
  128.          Width           =   1275
  129.       End
  130.    End
  131.    Begin VB.Label lbl_Result 
  132.       Appearance      =   0  'Flat
  133.       BackColor       =   &H80000005&
  134.       BackStyle       =   0  'Transparent
  135.       ForeColor       =   &H80000008&
  136.       Height          =   4110
  137.       Left            =   90
  138.       TabIndex        =   0
  139.       Top             =   630
  140.       Width           =   7305
  141.    End
  142. End
  143. Attribute VB_Name = "frmIeeenum"
  144. Attribute VB_GlobalNameSpace = False
  145. Attribute VB_Creatable = False
  146. Attribute VB_PredeclaredId = True
  147. Attribute VB_Exposed = False
  148. Option Explicit
  149. Option Base 1
  150.  
  151. Private Const Iteration = 250
  152.  
  153. Dim IsLoaded         As Integer
  154.  
  155. Dim TimerStartOk     As Integer
  156. Dim TimerCloseOk     As Integer
  157.  
  158. Dim TimerHandle      As Integer
  159. Dim TimerValue       As Long
  160.  
  161. Private Sub cmdNP_Click(Index As Integer)
  162.  
  163.    Call sub_NextPrev(cmb_Function, Index)
  164.  
  165. End Sub
  166.  
  167.  
  168. Private Sub cmb_Function_Click()
  169.    
  170.    If (IsLoaded = False) Then Exit Sub
  171.    
  172.    Call cDisableFI(mdiT2W.Picture1)
  173.    
  174.    lbl_Result = ""
  175.    
  176.    DoEvents
  177.    
  178.    Select Case cmb_Function.ListIndex
  179.       Case 0
  180.          Call TestByte
  181.       Case 1
  182.          Call TestInteger
  183.       Case 2
  184.          Call TestLong
  185.       Case 3
  186.          Call TestSingle
  187.       Case 4
  188.          Call TestDouble
  189.       Case 5
  190.          Call TestCurrency
  191.       Case 6
  192.          Call TestSMBF
  193.    End Select
  194.  
  195.    DoEvents
  196.    Call cEnableFI(mdiT2W.Picture1)
  197.    
  198. End Sub
  199.  
  200.  
  201. Private Sub Form_Activate()
  202.  
  203.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  204.  
  205. End Sub
  206.  
  207. Private Sub Form_Load()
  208.  
  209.    IsLoaded = False
  210.    
  211.    Show
  212.  
  213.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
  214.    
  215.    IsLoaded = True
  216.    
  217. End Sub
  218.  
  219. Private Sub SSCommand1_Click()
  220.    
  221.    Call cmb_Function_Click
  222.    
  223. End Sub
  224.  
  225.  
  226.  
  227.  
  228. Private Sub TestByte()
  229.    
  230.    Dim intResult        As Integer
  231.    Dim strResult        As String
  232.    Dim strDisplay       As String
  233.    
  234.    Dim i                As Integer
  235.    Dim j                As Byte
  236.    
  237.    strResult = ""
  238.    strDisplay = ""
  239.      
  240.    For i = 1 To 7
  241.       j = Int((255 - 1 + 1) * Rnd + 1)
  242.       strResult = cMKB(j)
  243.       strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  244.       strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
  245.    Next i
  246.    
  247.    lbl_Result = strDisplay
  248.  
  249.    'time the function
  250.  
  251.    TimerHandle = cTimerOpen()
  252.    TimerStartOk = cTimerStart(TimerHandle)
  253.    
  254.    For i = 1 To Iteration
  255.       strResult = cMKB(j)
  256.    Next i
  257.    
  258.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  259.    
  260.    TimerCloseOk = cTimerClose(TimerHandle)
  261.  
  262. End Sub
  263.  
  264.  
  265. Private Sub TestInteger()
  266.    
  267.    Dim intResult        As Integer
  268.    Dim strResult        As String
  269.    Dim strDisplay       As String
  270.    
  271.    Dim i                As Integer
  272.    Dim j                As Integer
  273.    
  274.    strResult = ""
  275.    strDisplay = ""
  276.    
  277.    Call cRndInit(-1)
  278.      
  279.    For i = 1 To 7
  280.       j = cRndI()
  281.       strResult = cMKI(j)
  282.       strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  283.       strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
  284.    Next i
  285.    
  286.    lbl_Result = strDisplay
  287.  
  288.    'time the function
  289.  
  290.    TimerHandle = cTimerOpen()
  291.    TimerStartOk = cTimerStart(TimerHandle)
  292.    
  293.    For i = 1 To Iteration
  294.       strResult = cMKI(j)
  295.    Next i
  296.    
  297.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  298.    
  299.    TimerCloseOk = cTimerClose(TimerHandle)
  300.  
  301. End Sub
  302.  
  303. Private Sub TestLong()
  304.    
  305.    Dim intResult        As Integer
  306.    Dim strResult        As String
  307.    Dim strDisplay       As String
  308.    
  309.    Dim i                As Integer
  310.    Dim j                As Long
  311.    
  312.    strResult = ""
  313.    strDisplay = ""
  314.    
  315.    Call cRndInit(-1)
  316.      
  317.    For i = 1 To 7
  318.       j = cRndL()
  319.       strResult = cMKL(j)
  320.       strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  321.       strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
  322.    Next i
  323.    
  324.    lbl_Result = strDisplay
  325.  
  326.    'time the function
  327.  
  328.    TimerHandle = cTimerOpen()
  329.    TimerStartOk = cTimerStart(TimerHandle)
  330.    
  331.    For i = 1 To Iteration
  332.       strResult = cMKL(j)
  333.    Next i
  334.    
  335.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  336.    
  337.    TimerCloseOk = cTimerClose(TimerHandle)
  338.  
  339. End Sub
  340.  
  341. Private Sub TestSingle()
  342.    
  343.    Dim intResult        As Integer
  344.    Dim strResult        As String
  345.    Dim strDisplay       As String
  346.    
  347.    Dim i                As Integer
  348.    Dim j                As Single
  349.    
  350.    strResult = ""
  351.    strDisplay = ""
  352.    
  353.    Call cRndInit(-1)
  354.      
  355.    For i = 1 To 7
  356.       j = cRndS()
  357.       strResult = cMKS(j)
  358.       strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  359.       strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
  360.    Next i
  361.    
  362.    lbl_Result = strDisplay
  363.  
  364.    'time the function
  365.  
  366.    TimerHandle = cTimerOpen()
  367.    TimerStartOk = cTimerStart(TimerHandle)
  368.    
  369.    For i = 1 To Iteration
  370.       strResult = cMKS(j)
  371.    Next i
  372.    
  373.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  374.    
  375.    TimerCloseOk = cTimerClose(TimerHandle)
  376.  
  377. End Sub
  378.  
  379. Private Sub TestDouble()
  380.    
  381.    Dim intResult        As Integer
  382.    Dim strResult        As String
  383.    Dim strDisplay       As String
  384.    
  385.    Dim i                As Integer
  386.    Dim j                As Double
  387.    
  388.    strResult = ""
  389.    strDisplay = ""
  390.    
  391.    Call cRndInit(-1)
  392.      
  393.    For i = 1 To 7
  394.       j = cRndD()
  395.       strResult = cMKD(j)
  396.       strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  397.       strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
  398.    Next i
  399.    
  400.    lbl_Result = strDisplay
  401.  
  402.    'time the function
  403.  
  404.    TimerHandle = cTimerOpen()
  405.    TimerStartOk = cTimerStart(TimerHandle)
  406.    
  407.    For i = 1 To Iteration
  408.       strResult = cMKD(j)
  409.    Next i
  410.    
  411.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  412.    
  413.    TimerCloseOk = cTimerClose(TimerHandle)
  414.  
  415. End Sub
  416.  
  417. Private Sub TestCurrency()
  418.    
  419.    Dim intResult        As Integer
  420.    Dim strResult        As String
  421.    Dim strDisplay       As String
  422.    
  423.    Dim i                As Integer
  424.    Dim j                As Currency
  425.    
  426.    strResult = ""
  427.    strDisplay = ""
  428.    
  429.    Call cRndInit(-1)
  430.      
  431.    For i = 1 To 7
  432.       j = cRndS()
  433.       strResult = cMKC(j)
  434.       strDisplay = strDisplay + "MKC of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  435.       strDisplay = strDisplay + "CVC of '0x" & cToHexa(strResult) & "' is '" & cCVC(strResult) & "'" & vbCrLf & vbCrLf
  436.    Next i
  437.    
  438.    lbl_Result = strDisplay
  439.  
  440.    'time the function
  441.  
  442.    TimerHandle = cTimerOpen()
  443.    TimerStartOk = cTimerStart(TimerHandle)
  444.    
  445.    For i = 1 To Iteration
  446.       strResult = cMKC(j)
  447.    Next i
  448.    
  449.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  450.    
  451.    TimerCloseOk = cTimerClose(TimerHandle)
  452.  
  453. End Sub
  454.  
  455. Private Sub TestSMBF()
  456.    
  457.    Dim intResult        As Integer
  458.    Dim strResult        As String
  459.    Dim strDisplay       As String
  460.    
  461.    Dim i                As Integer
  462.    Dim j                As Single
  463.    
  464.    strResult = ""
  465.    strDisplay = ""
  466.    
  467.    Call cRndInit(-1)
  468.      
  469.    For i = 1 To 7
  470.       j = cRndS()
  471.       strResult = cMKSMBF(j)
  472.       strDisplay = strDisplay + "MKSMBF of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  473.       strDisplay = strDisplay + "CVSMBF of '0x" & cToHexa(strResult) & "' is '" & cCVSMBF(strResult) & "'" & vbCrLf & vbCrLf
  474.    Next i
  475.    
  476.    lbl_Result = strDisplay
  477.  
  478.    'time the function
  479.  
  480.    TimerHandle = cTimerOpen()
  481.    TimerStartOk = cTimerStart(TimerHandle)
  482.    
  483.    For i = 1 To Iteration
  484.       strResult = cMKSMBF(j)
  485.    Next i
  486.    
  487.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  488.    
  489.    TimerCloseOk = cTimerClose(TimerHandle)
  490.  
  491. End Sub
  492.