home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _IEEENUM.FRM < prev    next >
Text File  |  1998-05-21  |  16KB  |  674 lines

  1. VERSION 5.00
  2. Begin VB.Form frmIeeenum 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Ieeenum"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   10905
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4845
  13.    ScaleWidth      =   10905
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   10905
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   10530
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   9630
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   9990
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   8175
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.Label lbl_Result 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       BackStyle       =   0  'Transparent
  68.       ForeColor       =   &H80000008&
  69.       Height          =   4110
  70.       Left            =   90
  71.       TabIndex        =   0
  72.       Top             =   630
  73.       Width           =   10635
  74.    End
  75. End
  76. Attribute VB_Name = "frmIeeenum"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83.  
  84. Private Const Iteration = 250
  85.  
  86. Dim IsLoaded         As Integer
  87.  
  88. Dim TimerStartOk     As Integer
  89. Dim TimerCloseOk     As Integer
  90.  
  91. Dim TimerHandle      As Integer
  92. Dim TimerValue       As Long
  93.  
  94. Private Sub cmdNP_Click(Index As Integer)
  95.  
  96.    Call sub_NextPrev(cmb_Function, Index)
  97.  
  98. End Sub
  99.  
  100.  
  101. Private Sub cmb_Function_Click()
  102.    
  103.    If (IsLoaded = False) Then Exit Sub
  104.    
  105.    Call cDisableFI(mdiT2W.Picture1)
  106.    
  107.    lbl_Result = ""
  108.    
  109.    DoEvents
  110.    
  111.    Select Case cmb_Function.ListIndex
  112.       Case 0
  113.          Call TestByte
  114.       Case 1
  115.          Call TestInteger
  116.       Case 2
  117.          Call TestLong
  118.       Case 3
  119.          Call TestSingle
  120.       Case 4
  121.          Call TestDouble
  122.       Case 5
  123.          Call TestCurrency
  124.       Case 6
  125.          Call TestSMBF
  126.       Case 7
  127.          Call TestGetByte
  128.       Case 8
  129.          Call TestGetInteger
  130.       Case 9
  131.          Call TestGetLong
  132.       Case 10
  133.          Call TestGetSingle
  134.       Case 11
  135.          Call TestGetDouble
  136.       Case 12
  137.          Call TestGetCurrency
  138.    End Select
  139.  
  140.    DoEvents
  141.    Call cEnableFI(mdiT2W.Picture1)
  142.    
  143. End Sub
  144.  
  145.  
  146. Private Sub Form_Activate()
  147.  
  148.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  149.  
  150. End Sub
  151.  
  152. Private Sub Form_Load()
  153.  
  154.    IsLoaded = False
  155.    
  156.    Show
  157.  
  158.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
  159.    
  160.    IsLoaded = True
  161.    
  162. End Sub
  163.  
  164. Private Sub Command1_Click()
  165.    
  166.    Call cmb_Function_Click
  167.    
  168. End Sub
  169.  
  170. Private Sub TestByte()
  171.    
  172.    Dim intResult        As Integer
  173.    Dim strResult        As String
  174.    Dim strDisplay       As String
  175.    
  176.    Dim i                As Integer
  177.    Dim j                As Byte
  178.    
  179.    strResult = ""
  180.    strDisplay = ""
  181.      
  182.    For i = 1 To 7
  183.       j = Int((255 - 1 + 1) * Rnd + 1)
  184.       strResult = cMKB(j)
  185.       strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  186.       strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
  187.    Next i
  188.    
  189.    lbl_Result = strDisplay
  190.  
  191.    'time the function
  192.  
  193.    TimerHandle = cTimerOpen()
  194.    TimerStartOk = cTimerStart(TimerHandle)
  195.    
  196.    For i = 1 To Iteration
  197.       strResult = cMKB(j)
  198.    Next i
  199.    
  200.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  201.    
  202.    TimerCloseOk = cTimerClose(TimerHandle)
  203.  
  204. End Sub
  205.  
  206.  
  207. Private Sub TestInteger()
  208.    
  209.    Dim intResult        As Integer
  210.    Dim strResult        As String
  211.    Dim strDisplay       As String
  212.    
  213.    Dim i                As Integer
  214.    Dim j                As Integer
  215.    
  216.    strResult = ""
  217.    strDisplay = ""
  218.    
  219.    Call cRndInit(-1)
  220.      
  221.    For i = 1 To 7
  222.       j = cRndI()
  223.       strResult = cMKI(j)
  224.       strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  225.       strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
  226.    Next i
  227.    
  228.    lbl_Result = strDisplay
  229.  
  230.    'time the function
  231.  
  232.    TimerHandle = cTimerOpen()
  233.    TimerStartOk = cTimerStart(TimerHandle)
  234.    
  235.    For i = 1 To Iteration
  236.       strResult = cMKI(j)
  237.    Next i
  238.    
  239.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  240.    
  241.    TimerCloseOk = cTimerClose(TimerHandle)
  242.  
  243. End Sub
  244.  
  245. Private Sub TestLong()
  246.    
  247.    Dim intResult        As Integer
  248.    Dim strResult        As String
  249.    Dim strDisplay       As String
  250.    
  251.    Dim i                As Integer
  252.    Dim j                As Long
  253.    
  254.    strResult = ""
  255.    strDisplay = ""
  256.    
  257.    Call cRndInit(-1)
  258.      
  259.    For i = 1 To 7
  260.       j = cRndL()
  261.       strResult = cMKL(j)
  262.       strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  263.       strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
  264.    Next i
  265.    
  266.    lbl_Result = strDisplay
  267.  
  268.    'time the function
  269.  
  270.    TimerHandle = cTimerOpen()
  271.    TimerStartOk = cTimerStart(TimerHandle)
  272.    
  273.    For i = 1 To Iteration
  274.       strResult = cMKL(j)
  275.    Next i
  276.    
  277.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  278.    
  279.    TimerCloseOk = cTimerClose(TimerHandle)
  280.  
  281. End Sub
  282.  
  283. Private Sub TestSingle()
  284.    
  285.    Dim intResult        As Integer
  286.    Dim strResult        As String
  287.    Dim strDisplay       As String
  288.    
  289.    Dim i                As Integer
  290.    Dim j                As Single
  291.    
  292.    strResult = ""
  293.    strDisplay = ""
  294.    
  295.    Call cRndInit(-1)
  296.      
  297.    For i = 1 To 7
  298.       j = cRndS()
  299.       strResult = cMKS(j)
  300.       strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  301.       strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
  302.    Next i
  303.    
  304.    lbl_Result = strDisplay
  305.  
  306.    'time the function
  307.  
  308.    TimerHandle = cTimerOpen()
  309.    TimerStartOk = cTimerStart(TimerHandle)
  310.    
  311.    For i = 1 To Iteration
  312.       strResult = cMKS(j)
  313.    Next i
  314.    
  315.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  316.    
  317.    TimerCloseOk = cTimerClose(TimerHandle)
  318.  
  319. End Sub
  320.  
  321. Private Sub TestDouble()
  322.    
  323.    Dim intResult        As Integer
  324.    Dim strResult        As String
  325.    Dim strDisplay       As String
  326.    
  327.    Dim i                As Integer
  328.    Dim j                As Double
  329.    
  330.    strResult = ""
  331.    strDisplay = ""
  332.    
  333.    Call cRndInit(-1)
  334.      
  335.    For i = 1 To 7
  336.       j = cRndD()
  337.       strResult = cMKD(j)
  338.       strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  339.       strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
  340.    Next i
  341.    
  342.    lbl_Result = strDisplay
  343.  
  344.    'time the function
  345.  
  346.    TimerHandle = cTimerOpen()
  347.    TimerStartOk = cTimerStart(TimerHandle)
  348.    
  349.    For i = 1 To Iteration
  350.       strResult = cMKD(j)
  351.    Next i
  352.    
  353.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  354.    
  355.    TimerCloseOk = cTimerClose(TimerHandle)
  356.  
  357. End Sub
  358.  
  359. Private Sub TestCurrency()
  360.    
  361.    Dim intResult        As Integer
  362.    Dim strResult        As String
  363.    Dim strDisplay       As String
  364.    
  365.    Dim i                As Integer
  366.    Dim j                As Currency
  367.    
  368.    strResult = ""
  369.    strDisplay = ""
  370.    
  371.    Call cRndInit(-1)
  372.      
  373.    For i = 1 To 7
  374.       j = cRndS()
  375.       strResult = cMKC(j)
  376.       strDisplay = strDisplay + "MKC of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  377.       strDisplay = strDisplay + "CVC of '0x" & cToHexa(strResult) & "' is '" & cCVC(strResult) & "'" & vbCrLf & vbCrLf
  378.    Next i
  379.    
  380.    lbl_Result = strDisplay
  381.  
  382.    'time the function
  383.  
  384.    TimerHandle = cTimerOpen()
  385.    TimerStartOk = cTimerStart(TimerHandle)
  386.    
  387.    For i = 1 To Iteration
  388.       strResult = cMKC(j)
  389.    Next i
  390.    
  391.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  392.    
  393.    TimerCloseOk = cTimerClose(TimerHandle)
  394.  
  395. End Sub
  396.  
  397. Private Sub TestSMBF()
  398.    
  399.    Dim intResult        As Integer
  400.    Dim strResult        As String
  401.    Dim strDisplay       As String
  402.    
  403.    Dim i                As Integer
  404.    Dim j                As Single
  405.    
  406.    strResult = ""
  407.    strDisplay = ""
  408.    
  409.    Call cRndInit(-1)
  410.      
  411.    For i = 1 To 7
  412.       j = cRndS()
  413.       strResult = cMKSMBF(j)
  414.       strDisplay = strDisplay + "MKSMBF of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  415.       strDisplay = strDisplay + "CVSMBF of '0x" & cToHexa(strResult) & "' is '" & cCVSMBF(strResult) & "'" & vbCrLf & vbCrLf
  416.    Next i
  417.    
  418.    lbl_Result = strDisplay
  419.  
  420.    'time the function
  421.  
  422.    TimerHandle = cTimerOpen()
  423.    TimerStartOk = cTimerStart(TimerHandle)
  424.    
  425.    For i = 1 To Iteration
  426.       strResult = cMKSMBF(j)
  427.    Next i
  428.    
  429.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  430.    
  431.    TimerCloseOk = cTimerClose(TimerHandle)
  432.  
  433. End Sub
  434.  
  435. Private Sub TestGetByte()
  436.    
  437.    Dim intResult        As Integer
  438.    Dim strResult        As String
  439.    Dim strDisplay       As String
  440.    Dim s                As String
  441.    
  442.    Dim i                As Integer
  443.    Dim j                As Byte
  444.    
  445.    strResult = ""
  446.    strDisplay = ""
  447.    s = String$(32, 0)
  448.      
  449.    For i = 1 To 4
  450.       j = Int((255 - 1 + 1) * Rnd + 1)
  451.       strDisplay = strDisplay + "PutMKB '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  452.       Call cPutMKB(s, i, j)
  453.       strDisplay = strDisplay + "GetCVB at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVB(s, i) & "'" & vbCrLf & vbCrLf
  454.    Next i
  455.    
  456.    lbl_Result = strDisplay
  457.  
  458.    'time the function
  459.  
  460.    TimerHandle = cTimerOpen()
  461.    TimerStartOk = cTimerStart(TimerHandle)
  462.    
  463.    For i = 1 To Iteration
  464.       Call cPutMKB(s, 1, j)
  465.    Next i
  466.    
  467.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  468.    
  469.    TimerCloseOk = cTimerClose(TimerHandle)
  470.  
  471. End Sub
  472.  
  473. Private Sub TestGetInteger()
  474.    
  475.    Dim intResult        As Integer
  476.    Dim strResult        As String
  477.    Dim strDisplay       As String
  478.    Dim s                As String
  479.    
  480.    Dim i                As Integer
  481.    Dim j                As Integer
  482.    
  483.    strResult = ""
  484.    strDisplay = ""
  485.    s = String$(32, 0)
  486.    
  487.    Call cRndInit(-1)
  488.      
  489.    For i = 1 To 4
  490.       j = cRndI()
  491.       strDisplay = strDisplay + "PutMKI '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  492.       Call cPutMKI(s, i, j)
  493.       strDisplay = strDisplay + "GetCVI at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVI(s, i) & "'" & vbCrLf & vbCrLf
  494.    Next i
  495.    
  496.    lbl_Result = strDisplay
  497.  
  498.    'time the function
  499.  
  500.    TimerHandle = cTimerOpen()
  501.    TimerStartOk = cTimerStart(TimerHandle)
  502.    
  503.    For i = 1 To Iteration
  504.       Call cPutMKI(s, 1, j)
  505.    Next i
  506.    
  507.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  508.    
  509.    TimerCloseOk = cTimerClose(TimerHandle)
  510.  
  511. End Sub
  512.  
  513. Private Sub TestGetLong()
  514.    
  515.    Dim intResult        As Integer
  516.    Dim strResult        As String
  517.    Dim strDisplay       As String
  518.    Dim s                As String
  519.    
  520.    Dim i                As Integer
  521.    Dim j                As Long
  522.    
  523.    strResult = ""
  524.    strDisplay = ""
  525.    s = String$(32, 0)
  526.    
  527.    Call cRndInit(-1)
  528.      
  529.    For i = 1 To 4
  530.       j = cRndL()
  531.       strDisplay = strDisplay + "PutMKL '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  532.       Call cPutMKL(s, i, j)
  533.       strDisplay = strDisplay + "GetCVL at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVL(s, i) & "'" & vbCrLf & vbCrLf
  534.    Next i
  535.    
  536.    lbl_Result = strDisplay
  537.  
  538.    'time the function
  539.  
  540.    TimerHandle = cTimerOpen()
  541.    TimerStartOk = cTimerStart(TimerHandle)
  542.    
  543.    For i = 1 To Iteration
  544.       Call cPutMKL(s, 1, j)
  545.    Next i
  546.    
  547.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  548.    
  549.    TimerCloseOk = cTimerClose(TimerHandle)
  550.  
  551. End Sub
  552.  
  553. Private Sub TestGetSingle()
  554.    
  555.    Dim intResult        As Integer
  556.    Dim strResult        As String
  557.    Dim strDisplay       As String
  558.    Dim s                As String
  559.    
  560.    Dim i                As Integer
  561.    Dim j                As Single
  562.    
  563.    strResult = ""
  564.    strDisplay = ""
  565.    s = String$(32, 0)
  566.    
  567.    Call cRndInit(-1)
  568.      
  569.    For i = 1 To 4
  570.       j = cRndS()
  571.       strDisplay = strDisplay + "PutMKS '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  572.       Call cPutMKS(s, i, j)
  573.       strDisplay = strDisplay + "GetCVS at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVS(s, i) & "'" & vbCrLf & vbCrLf
  574.    Next i
  575.    
  576.    lbl_Result = strDisplay
  577.  
  578.    'time the function
  579.  
  580.    TimerHandle = cTimerOpen()
  581.    TimerStartOk = cTimerStart(TimerHandle)
  582.    
  583.    For i = 1 To Iteration
  584.       Call cPutMKS(s, 1, j)
  585.    Next i
  586.    
  587.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  588.    
  589.    TimerCloseOk = cTimerClose(TimerHandle)
  590.  
  591. End Sub
  592.  
  593. Private Sub TestGetDouble()
  594.    
  595.    Dim intResult        As Integer
  596.    Dim strResult        As String
  597.    Dim strDisplay       As String
  598.    Dim s                As String
  599.    
  600.    Dim i                As Integer
  601.    Dim j                As Double
  602.    
  603.    strResult = ""
  604.    strDisplay = ""
  605.    s = String$(32, 0)
  606.    
  607.    Call cRndInit(-1)
  608.      
  609.    For i = 1 To 4
  610.       j = cRndD()
  611.       strDisplay = strDisplay + "PutMKD '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  612.       Call cPutMKD(s, i, j)
  613.       strDisplay = strDisplay + "GetCVD at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVD(s, i) & "'" & vbCrLf & vbCrLf
  614.    Next i
  615.    
  616.    lbl_Result = strDisplay
  617.  
  618.    'time the function
  619.  
  620.    TimerHandle = cTimerOpen()
  621.    TimerStartOk = cTimerStart(TimerHandle)
  622.    
  623.    For i = 1 To Iteration
  624.       Call cPutMKD(s, 1, j)
  625.    Next i
  626.    
  627.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  628.    
  629.    TimerCloseOk = cTimerClose(TimerHandle)
  630.  
  631. End Sub
  632.  
  633. Private Sub TestGetCurrency()
  634.    
  635.    Dim intResult        As Integer
  636.    Dim strResult        As String
  637.    Dim strDisplay       As String
  638.    Dim s                As String
  639.    
  640.    Dim i                As Integer
  641.    Dim j                As Currency
  642.    
  643.    strResult = ""
  644.    strDisplay = ""
  645.    s = String$(32, 0)
  646.    
  647.    Call cRndInit(-1)
  648.      
  649.    For i = 1 To 4
  650.       j = cRndL()
  651.       strDisplay = strDisplay + "PutMKC '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
  652.       Call cPutMKC(s, i, j)
  653.       strDisplay = strDisplay + "GetCVC at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVC(s, i) & "'" & vbCrLf & vbCrLf
  654.    Next i
  655.    
  656.    lbl_Result = strDisplay
  657.  
  658.    'time the function
  659.  
  660.    TimerHandle = cTimerOpen()
  661.    TimerStartOk = cTimerStart(TimerHandle)
  662.    
  663.    For i = 1 To Iteration
  664.       Call cPutMKC(s, 1, j)
  665.    Next i
  666.    
  667.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  668.    
  669.    TimerCloseOk = cTimerClose(TimerHandle)
  670.  
  671. End Sub
  672.  
  673.  
  674.