home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 35
/
hot35.iso
/
ficheros
/
LVB
/
T2W32543.ZIP
/
_IEEENUM.FRM
< prev
next >
Wrap
Text File
|
1998-05-21
|
16KB
|
674 lines
VERSION 5.00
Begin VB.Form frmIeeenum
BorderStyle = 4 'Fixed ToolWindow
Caption = "Ieeenum"
ClientHeight = 4845
ClientLeft = 1890
ClientTop = 3270
ClientWidth = 10905
MaxButton = 0 'False
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 4845
ScaleWidth = 10905
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Height = 570
Left = 0
TabIndex = 1
Top = -90
Width = 10905
Begin VB.CommandButton cmdNP
Caption = ">"
Height = 285
Index = 1
Left = 10530
TabIndex = 6
Top = 195
Width = 285
End
Begin VB.CommandButton cmdNP
Caption = "<"
Height = 285
Index = 0
Left = 9630
TabIndex = 5
Top = 195
Width = 285
End
Begin VB.CommandButton Command1
Caption = "&Go"
Default = -1 'True
Height = 285
Left = 9990
TabIndex = 4
Top = 195
Width = 465
End
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 2
Top = 180
Width = 8175
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 3
Top = 210
Width = 1275
End
End
Begin VB.Label lbl_Result
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H80000008&
Height = 4110
Left = 90
TabIndex = 0
Top = 630
Width = 10635
End
End
Attribute VB_Name = "frmIeeenum"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 250
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
lbl_Result = ""
DoEvents
Select Case cmb_Function.ListIndex
Case 0
Call TestByte
Case 1
Call TestInteger
Case 2
Call TestLong
Case 3
Call TestSingle
Case 4
Call TestDouble
Case 5
Call TestCurrency
Case 6
Call TestSMBF
Case 7
Call TestGetByte
Case 8
Call TestGetInteger
Case 9
Call TestGetLong
Case 10
Call TestGetSingle
Case 11
Call TestGetDouble
Case 12
Call TestGetCurrency
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
IsLoaded = True
End Sub
Private Sub Command1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestByte()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Byte
strResult = ""
strDisplay = ""
For i = 1 To 7
j = Int((255 - 1 + 1) * Rnd + 1)
strResult = cMKB(j)
strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKB(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestInteger()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Integer
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndI()
strResult = cMKI(j)
strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKI(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestLong()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Long
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndL()
strResult = cMKL(j)
strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKL(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestSingle()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Single
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndS()
strResult = cMKS(j)
strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKS(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestDouble()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Double
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndD()
strResult = cMKD(j)
strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKD(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestCurrency()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Currency
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndS()
strResult = cMKC(j)
strDisplay = strDisplay + "MKC of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVC of '0x" & cToHexa(strResult) & "' is '" & cCVC(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKC(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestSMBF()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim j As Single
strResult = ""
strDisplay = ""
Call cRndInit(-1)
For i = 1 To 7
j = cRndS()
strResult = cMKSMBF(j)
strDisplay = strDisplay + "MKSMBF of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
strDisplay = strDisplay + "CVSMBF of '0x" & cToHexa(strResult) & "' is '" & cCVSMBF(strResult) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cMKSMBF(j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetByte()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Byte
strResult = ""
strDisplay = ""
s = String$(32, 0)
For i = 1 To 4
j = Int((255 - 1 + 1) * Rnd + 1)
strDisplay = strDisplay + "PutMKB '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKB(s, i, j)
strDisplay = strDisplay + "GetCVB at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVB(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKB(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetInteger()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Integer
strResult = ""
strDisplay = ""
s = String$(32, 0)
Call cRndInit(-1)
For i = 1 To 4
j = cRndI()
strDisplay = strDisplay + "PutMKI '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKI(s, i, j)
strDisplay = strDisplay + "GetCVI at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVI(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKI(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetLong()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Long
strResult = ""
strDisplay = ""
s = String$(32, 0)
Call cRndInit(-1)
For i = 1 To 4
j = cRndL()
strDisplay = strDisplay + "PutMKL '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKL(s, i, j)
strDisplay = strDisplay + "GetCVL at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVL(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKL(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetSingle()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Single
strResult = ""
strDisplay = ""
s = String$(32, 0)
Call cRndInit(-1)
For i = 1 To 4
j = cRndS()
strDisplay = strDisplay + "PutMKS '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKS(s, i, j)
strDisplay = strDisplay + "GetCVS at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVS(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKS(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetDouble()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Double
strResult = ""
strDisplay = ""
s = String$(32, 0)
Call cRndInit(-1)
For i = 1 To 4
j = cRndD()
strDisplay = strDisplay + "PutMKD '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKD(s, i, j)
strDisplay = strDisplay + "GetCVD at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVD(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKD(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestGetCurrency()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim s As String
Dim i As Integer
Dim j As Currency
strResult = ""
strDisplay = ""
s = String$(32, 0)
Call cRndInit(-1)
For i = 1 To 4
j = cRndL()
strDisplay = strDisplay + "PutMKC '" & j & "' at position '" & i & "' in string '" & cToHexa(s) & "'" & vbCrLf
Call cPutMKC(s, i, j)
strDisplay = strDisplay + "GetCVC at position '" & i & "' in string '" & cToHexa(s) & "' is '" & cGetCVC(s, i) & "'" & vbCrLf & vbCrLf
Next i
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
Call cPutMKC(s, 1, j)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub