home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32534.ZIP / _BITSTR.FRM < prev    next >
Text File  |  1998-05-02  |  38KB  |  1,218 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmBitString 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Bit string"
  6.    ClientHeight    =   4035
  7.    ClientLeft      =   870
  8.    ClientTop       =   2115
  9.    ClientWidth     =   9885
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   4035
  14.    ScaleWidth      =   9885
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.TextBox txt_Result 
  17.       BackColor       =   &H00C0C0C0&
  18.       BorderStyle     =   0  'None
  19.       Height          =   2895
  20.       Left            =   90
  21.       Locked          =   -1  'True
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   10
  25.       Top             =   540
  26.       Width           =   9645
  27.    End
  28.    Begin Threed.SSPanel SSPanel2 
  29.       Align           =   2  'Align Bottom
  30.       Height          =   465
  31.       Left            =   0
  32.       TabIndex        =   0
  33.       Top             =   3570
  34.       Width           =   9885
  35.       _Version        =   65536
  36.       _ExtentX        =   17436
  37.       _ExtentY        =   820
  38.       _StockProps     =   15
  39.       BackColor       =   12632256
  40.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  41.          Name            =   "MS Sans Serif"
  42.          Size            =   8.25
  43.          Charset         =   0
  44.          Weight          =   400
  45.          Underline       =   0   'False
  46.          Italic          =   0   'False
  47.          Strikethrough   =   0   'False
  48.       EndProperty
  49.       Begin VB.TextBox Text1 
  50.          Height          =   285
  51.          Left            =   1440
  52.          TabIndex        =   2
  53.          Tag             =   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  54.          Top             =   90
  55.          Width           =   7485
  56.       End
  57.       Begin Threed.SSCommand SSCommand2 
  58.          Height          =   285
  59.          Left            =   9000
  60.          TabIndex        =   3
  61.          Top             =   90
  62.          Width           =   825
  63.          _Version        =   65536
  64.          _ExtentX        =   1455
  65.          _ExtentY        =   503
  66.          _StockProps     =   78
  67.          Caption         =   "&Reset"
  68.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  69.             Name            =   "MS Sans Serif"
  70.             Size            =   8.25
  71.             Charset         =   0
  72.             Weight          =   400
  73.             Underline       =   0   'False
  74.             Italic          =   0   'False
  75.             Strikethrough   =   0   'False
  76.          EndProperty
  77.          BevelWidth      =   1
  78.          Outline         =   0   'False
  79.       End
  80.       Begin VB.Label Label1 
  81.          Caption         =   "&Enter a test string"
  82.          Height          =   255
  83.          Left            =   90
  84.          TabIndex        =   1
  85.          Top             =   120
  86.          Width           =   1275
  87.       End
  88.    End
  89.    Begin Threed.SSPanel SSPanel1 
  90.       Align           =   1  'Align Top
  91.       Height          =   480
  92.       Left            =   0
  93.       TabIndex        =   4
  94.       Top             =   0
  95.       Width           =   9885
  96.       _Version        =   65536
  97.       _ExtentX        =   17436
  98.       _ExtentY        =   847
  99.       _StockProps     =   15
  100.       ForeColor       =   -2147483640
  101.       BackColor       =   12632256
  102.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  103.          Name            =   "MS Sans Serif"
  104.          Size            =   8.25
  105.          Charset         =   0
  106.          Weight          =   400
  107.          Underline       =   0   'False
  108.          Italic          =   0   'False
  109.          Strikethrough   =   0   'False
  110.       EndProperty
  111.       Begin VB.ComboBox cmb_Function 
  112.          Height          =   315
  113.          Left            =   1365
  114.          TabIndex        =   5
  115.          Top             =   75
  116.          Width           =   7305
  117.       End
  118.       Begin Threed.SSCommand cmdNP 
  119.          Height          =   300
  120.          Index           =   1
  121.          Left            =   9570
  122.          TabIndex        =   9
  123.          Top             =   90
  124.          Width           =   255
  125.          _Version        =   65536
  126.          _ExtentX        =   450
  127.          _ExtentY        =   529
  128.          _StockProps     =   78
  129.          Caption         =   ">"
  130.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  131.             Name            =   "MS Sans Serif"
  132.             Size            =   8.25
  133.             Charset         =   0
  134.             Weight          =   400
  135.             Underline       =   0   'False
  136.             Italic          =   0   'False
  137.             Strikethrough   =   0   'False
  138.          EndProperty
  139.          BevelWidth      =   1
  140.          Font3D          =   3
  141.          RoundedCorners  =   0   'False
  142.          Outline         =   0   'False
  143.       End
  144.       Begin Threed.SSCommand cmdNP 
  145.          Height          =   300
  146.          Index           =   0
  147.          Left            =   8730
  148.          TabIndex        =   8
  149.          Top             =   90
  150.          Width           =   255
  151.          _Version        =   65536
  152.          _ExtentX        =   450
  153.          _ExtentY        =   529
  154.          _StockProps     =   78
  155.          Caption         =   "<"
  156.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  157.             Name            =   "MS Sans Serif"
  158.             Size            =   8.25
  159.             Charset         =   0
  160.             Weight          =   400
  161.             Underline       =   0   'False
  162.             Italic          =   0   'False
  163.             Strikethrough   =   0   'False
  164.          EndProperty
  165.          BevelWidth      =   1
  166.          Font3D          =   3
  167.          RoundedCorners  =   0   'False
  168.          Outline         =   0   'False
  169.       End
  170.       Begin Threed.SSCommand SSCommand1 
  171.          Default         =   -1  'True
  172.          Height          =   300
  173.          Left            =   9045
  174.          TabIndex        =   6
  175.          Top             =   90
  176.          Width           =   465
  177.          _Version        =   65536
  178.          _ExtentX        =   820
  179.          _ExtentY        =   529
  180.          _StockProps     =   78
  181.          Caption         =   "&Go"
  182.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  183.             Name            =   "MS Sans Serif"
  184.             Size            =   8.25
  185.             Charset         =   0
  186.             Weight          =   400
  187.             Underline       =   0   'False
  188.             Italic          =   0   'False
  189.             Strikethrough   =   0   'False
  190.          EndProperty
  191.          BevelWidth      =   1
  192.          RoundedCorners  =   0   'False
  193.          Outline         =   0   'False
  194.       End
  195.       Begin VB.Label Label2 
  196.          Caption         =   "&Select a function"
  197.          Height          =   255
  198.          Left            =   90
  199.          TabIndex        =   7
  200.          Top             =   120
  201.          Width           =   1275
  202.       End
  203.    End
  204. End
  205. Attribute VB_Name = "frmBitString"
  206. Attribute VB_GlobalNameSpace = False
  207. Attribute VB_Creatable = False
  208. Attribute VB_PredeclaredId = True
  209. Attribute VB_Exposed = False
  210. Option Explicit
  211. Option Base 1
  212.  
  213. Private Const Iteration = 250
  214.  
  215. Dim IsLoaded         As Integer
  216.  
  217. Dim TimerStartOk     As Integer
  218. Dim TimerCloseOk     As Integer
  219.  
  220. Dim TimerHandle      As Integer
  221. Dim TimerValue       As Long
  222.  
  223. Private Sub cmb_Function_Click()
  224.    
  225.    If (IsLoaded = False) Then Exit Sub
  226.    
  227.    Call cDisableFI(mdiT2W.Picture1)
  228.    
  229.    SSPanel2.Visible = True
  230.    
  231.    txt_Result = ""
  232.    
  233.    DoEvents
  234.    
  235.    Select Case cmb_Function.ListIndex
  236.       Case 0
  237.          SSPanel2.Visible = False
  238.          Call TestCreateBits
  239.       Case 1
  240.          Call TestFindBitReset
  241.       Case 2
  242.          Call TestFindBitSet
  243.       Case 3
  244.          Call TestGetBit
  245.       Case 4
  246.          SSPanel2.Visible = False
  247.          Call TestGiveBitPalindrome
  248.       Case 5
  249.          Call TestIsBitPalindrome
  250.       Case 6
  251.          Call TestReverseAllBits
  252.       Case 7
  253.          Call TestReverseAllBitsByChar
  254.       Case 8
  255.          Call TestSetAllBits
  256.       Case 9
  257.          Call TestSetBit
  258.       Case 10
  259.          Call TestToggleAllBits
  260.       Case 11
  261.          Call TestToggleBit
  262.       Case 12
  263.          SSPanel2.Visible = False
  264.          Call TestGetBitValue
  265.       Case 13
  266.          SSPanel2.Visible = False
  267.          Call TestSetBitValue
  268.       Case 14
  269.          SSPanel2.Visible = False
  270.          Call TestB2I
  271.       Case 15
  272.          SSPanel2.Visible = False
  273.          Call TestGetBit2Value
  274.       Case 16
  275.          SSPanel2.Visible = False
  276.          Call TestSetBit2Value
  277.       Case 17
  278.          SSPanel2.Visible = False
  279.          Call TestB2I
  280.    End Select
  281.  
  282.    DoEvents
  283.    Call cEnableFI(mdiT2W.Picture1)
  284.    
  285. End Sub
  286.  
  287.  
  288. Private Sub cmdNP_Click(Index As Integer)
  289.  
  290.    Call sub_NextPrev(cmb_Function, Index)
  291.  
  292. End Sub
  293.  
  294. Private Sub Form_Activate()
  295.  
  296.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  297.  
  298. End Sub
  299.  
  300. Private Sub Form_Load()
  301.  
  302.    IsLoaded = False
  303.    
  304.    Show
  305.  
  306.    Text1.Text = Text1.Tag + LCase$(Text1.Tag)
  307.  
  308.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_bitstr.t2w")
  309.    
  310.    IsLoaded = True
  311.    
  312. End Sub
  313.  
  314. Private Sub SSCommand1_Click()
  315.    
  316.    Call cmb_Function_Click
  317.    
  318. End Sub
  319.  
  320.  
  321.  
  322.  
  323. Private Sub TestCreateBits()
  324.    
  325.    Dim intResult        As Integer
  326.    Dim strResult        As String
  327.    Dim strDisplay       As String
  328.    
  329.    Dim i                As Integer
  330.    
  331.    intResult = 0
  332.    
  333.    strResult = ""
  334.    strDisplay = ""
  335.      
  336.    strResult = cCreateBits(1024)
  337.    strDisplay = strDisplay + "Create a bit string for 1024 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  338.    
  339.    strResult = cCreateBits(512)
  340.    strDisplay = strDisplay + "Create a bit string for 512 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  341.  
  342.    strResult = cCreateBits(33)
  343.    strDisplay = strDisplay + "Create a bit string for 33 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  344.  
  345.    strResult = cCreateBits(1)
  346.    strDisplay = strDisplay + "Create a bit string for 1 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  347.  
  348.    strResult = cCreateBits(-1)
  349.    strDisplay = strDisplay + "Create a bit string for -1 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  350.  
  351.    txt_Result = strDisplay
  352.  
  353.    'time the function
  354.  
  355.    TimerHandle = cTimerOpen()
  356.    TimerStartOk = cTimerStart(TimerHandle)
  357.    
  358.    For i = 1 To Iteration
  359.       strResult = cCreateBits(1024)
  360.    Next i
  361.    
  362.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  363.    
  364.    TimerCloseOk = cTimerClose(TimerHandle)
  365.  
  366. End Sub
  367.  
  368.  
  369.  
  370.  
  371. Private Sub TestFindBitReset()
  372.    
  373.    Dim intResult        As Integer
  374.    Dim strResult        As String
  375.    Dim strDisplay       As String
  376.    
  377.    Dim strData          As String
  378.    
  379.    Dim i                As Integer
  380.    
  381.    intResult = 0
  382.    
  383.    strResult = ""
  384.    strDisplay = ""
  385.      
  386.    strData = Text1.Text
  387.    
  388.    strDisplay = strDisplay + "The following bits are Reset (False) " & vbCrLf & vbCrLf
  389.    
  390.    intResult = True
  391.    
  392.    Do
  393.       intResult = cFindBitReset(strData, intResult)
  394.       If (intResult <> True) Then strDisplay = strDisplay & intResult & ", "
  395.    Loop Until (intResult = True)
  396.    
  397.    strDisplay = Left$(strDisplay, Len(strDisplay) - 1)
  398.    
  399.    strDisplay = strDisplay & vbCrLf & vbCrLf
  400.  
  401.    txt_Result = strDisplay
  402.  
  403.    'time the function
  404.  
  405.    TimerHandle = cTimerOpen()
  406.    TimerStartOk = cTimerStart(TimerHandle)
  407.    
  408.    For i = 1 To Iteration
  409.       intResult = cFindBitReset(strData, i)
  410.    Next i
  411.    
  412.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  413.    
  414.    TimerCloseOk = cTimerClose(TimerHandle)
  415.  
  416. End Sub
  417.  
  418. Private Sub SSCommand2_Click()
  419.    
  420.    Text1.Text = Text1.Tag + LCase$(Text1.Tag)
  421.    
  422.    Call SSCommand1_Click
  423.    
  424. End Sub
  425.  
  426.  
  427.  
  428. Private Sub TestFindBitSet()
  429.    
  430.    Dim intResult        As Integer
  431.    Dim strResult        As String
  432.    Dim strDisplay       As String
  433.    
  434.    Dim strData          As String
  435.    
  436.    Dim i                As Integer
  437.    
  438.    intResult = 0
  439.    
  440.    strResult = ""
  441.    strDisplay = ""
  442.      
  443.    strData = Text1.Text
  444.    
  445.    strDisplay = strDisplay + "The following bits are Set (True) " & vbCrLf & vbCrLf
  446.    
  447.    intResult = True
  448.    
  449.    Do
  450.       intResult = cFindBitSet(strData, intResult)
  451.       If (intResult <> True) Then strDisplay = strDisplay & intResult & ", "
  452.    Loop Until (intResult = True)
  453.    
  454.    strDisplay = Left$(strDisplay, Len(strDisplay) - 1)
  455.    
  456.    strDisplay = strDisplay & vbCrLf & vbCrLf
  457.  
  458.    txt_Result = strDisplay
  459.  
  460.    'time the function
  461.  
  462.    TimerHandle = cTimerOpen()
  463.    TimerStartOk = cTimerStart(TimerHandle)
  464.    
  465.    For i = 1 To Iteration
  466.       intResult = cFindBitSet(strData, i)
  467.    Next i
  468.    
  469.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  470.    
  471.    TimerCloseOk = cTimerClose(TimerHandle)
  472.  
  473. End Sub
  474.  
  475. Private Sub TestGetBit()
  476.    
  477.    Dim intResult        As Integer
  478.    Dim strResult        As String
  479.    Dim strDisplay       As String
  480.    
  481.    Dim strData          As String
  482.    
  483.    Dim i                As Integer
  484.    
  485.    intResult = 0
  486.    
  487.    strResult = ""
  488.    strDisplay = ""
  489.      
  490.    strData = Text1.Text
  491.    
  492.    strDisplay = strDisplay + "Bit '1' is '" & IIf(cGetBit(strData, 1), "set", "reset") & "'" & vbCrLf
  493.    strDisplay = strDisplay + "Bit '3' is '" & IIf(cGetBit(strData, 3), "set", "reset") & "'" & vbCrLf
  494.    strDisplay = strDisplay + "Bit '5' is '" & IIf(cGetBit(strData, 5), "set", "reset") & "'" & vbCrLf
  495.    strDisplay = strDisplay + "Bit '7' is '" & IIf(cGetBit(strData, 7), "set", "reset") & "'" & vbCrLf
  496.    strDisplay = strDisplay + "Bit '100' is '" & IIf(cGetBit(strData, 100), "set", "reset") & "'" & vbCrLf
  497.    strDisplay = strDisplay + "Bit '102' is '" & IIf(cGetBit(strData, 102), "set", "reset") & "'" & vbCrLf
  498.    strDisplay = strDisplay + "Bit '104' is '" & IIf(cGetBit(strData, 104), "set", "reset") & "'" & vbCrLf
  499.    strDisplay = strDisplay + "Bit '106' is '" & IIf(cGetBit(strData, 106), "set", "reset") & "'" & vbCrLf
  500.    
  501.    
  502.    txt_Result = strDisplay
  503.  
  504.    'time the function
  505.  
  506.    TimerHandle = cTimerOpen()
  507.    TimerStartOk = cTimerStart(TimerHandle)
  508.    
  509.    For i = 1 To Iteration
  510.       intResult = cGetBit(strData, i)
  511.    Next i
  512.    
  513.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  514.    
  515.    TimerCloseOk = cTimerClose(TimerHandle)
  516.  
  517. End Sub
  518.  
  519. Private Sub TestGiveBitPalindrome()
  520.    
  521.    Dim intResult        As Integer
  522.    Dim strResult        As String
  523.    Dim strDisplay       As String
  524.    
  525.    Dim strData          As String
  526.    
  527.    Dim i                As Integer
  528.    
  529.    intResult = 0
  530.    
  531.    strResult = ""
  532.    strDisplay = ""
  533.      
  534.    strResult = cGiveBitPalindrome()
  535.    
  536.    strDisplay = strDisplay + "The followings chars are Bit Palindrome : " & vbCrLf & vbCrLf
  537.    strDisplay = strDisplay + "chr(0) and  " & cBlockCharFromRight(cGiveBitPalindrome(), 1)
  538.    
  539.    txt_Result = strDisplay
  540.  
  541.    'time the function
  542.  
  543.    TimerHandle = cTimerOpen()
  544.    TimerStartOk = cTimerStart(TimerHandle)
  545.    
  546.    For i = 1 To Iteration
  547.       strResult = cGiveBitPalindrome()
  548.    Next i
  549.    
  550.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  551.    
  552.    TimerCloseOk = cTimerClose(TimerHandle)
  553.  
  554. End Sub
  555.  
  556. Private Sub TestIsBitPalindrome()
  557.    
  558.    Dim intResult        As Integer
  559.    Dim strResult        As String
  560.    Dim strDisplay       As String
  561.    
  562.    Dim strData          As String
  563.    
  564.    Dim i                As Integer
  565.    
  566.    intResult = 0
  567.    
  568.    strResult = ""
  569.    strDisplay = ""
  570.    
  571.    strData = Text1.Text
  572.      
  573.    intResult = cIsBitPalindrome(strData)
  574.    
  575.    strDisplay = strDisplay + "Test string is " & IIf(intResult, "", "not ") & "Bit Palindrome " & vbCrLf & vbCrLf
  576.    
  577.    strDisplay = strDisplay + "The followings chars are Bit Palindrome : " & vbCrLf
  578.    
  579.    For i = 1 To 255
  580.       If cIsBitPalindrome(Chr$(i)) Then strDisplay = strDisplay + Chr$(i) & " (" & i & ") "
  581.    Next i
  582.  
  583.    txt_Result = strDisplay
  584.  
  585.    'time the function
  586.  
  587.    TimerHandle = cTimerOpen()
  588.    TimerStartOk = cTimerStart(TimerHandle)
  589.    
  590.    For i = 1 To Iteration
  591.       intResult = cIsBitPalindrome(strData)
  592.    Next i
  593.    
  594.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  595.    
  596.    TimerCloseOk = cTimerClose(TimerHandle)
  597.  
  598. End Sub
  599.  
  600. Private Sub TestReverseAllBits()
  601.    
  602.    Dim intResult        As Integer
  603.    Dim strResult        As String
  604.    Dim strDisplay       As String
  605.    
  606.    Dim strData          As String
  607.    
  608.    Dim i                As Integer
  609.    
  610.    intResult = 0
  611.    
  612.    strResult = ""
  613.    strDisplay = ""
  614.    
  615.    strData = Text1.Text
  616.      
  617.    Call cReverseAllBits(strData)
  618.    strDisplay = strDisplay + "Reverse all bits is " & vbCrLf & strData & vbCrLf & vbCrLf
  619.    
  620.    Call cReverseAllBits(strData)
  621.    strDisplay = strDisplay + "Reverse all bits of the reversed is " & vbCrLf & strData & vbCrLf & vbCrLf
  622.    
  623.    txt_Result = strDisplay
  624.  
  625.    'time the function
  626.  
  627.    TimerHandle = cTimerOpen()
  628.    TimerStartOk = cTimerStart(TimerHandle)
  629.    
  630.    For i = 1 To Iteration
  631.       Call cReverseAllBits(strData)
  632.    Next i
  633.    
  634.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  635.    
  636.    TimerCloseOk = cTimerClose(TimerHandle)
  637.  
  638. End Sub
  639.  
  640. Private Sub TestReverseAllBitsByChar()
  641.    
  642.    Dim intResult        As Integer
  643.    Dim strResult        As String
  644.    Dim strDisplay       As String
  645.    
  646.    Dim strData          As String
  647.    
  648.    Dim i                As Integer
  649.    
  650.    intResult = 0
  651.    
  652.    strResult = ""
  653.    strDisplay = ""
  654.    
  655.    strData = Text1.Text
  656.      
  657.    Call cReverseAllBitsByChar(strData)
  658.    strDisplay = strDisplay + "Reverse all bits by char is " & vbCrLf & strData & vbCrLf & vbCrLf
  659.    
  660.    Call cReverseAllBitsByChar(strData)
  661.    strDisplay = strDisplay + "Reverse all bits by char of the reversed is " & vbCrLf & strData & vbCrLf & vbCrLf
  662.    
  663.    txt_Result = strDisplay
  664.  
  665.    'time the function
  666.  
  667.    TimerHandle = cTimerOpen()
  668.    TimerStartOk = cTimerStart(TimerHandle)
  669.    
  670.    For i = 1 To Iteration
  671.       Call cReverseAllBitsByChar(strData)
  672.    Next i
  673.    
  674.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  675.    
  676.    TimerCloseOk = cTimerClose(TimerHandle)
  677.  
  678. End Sub
  679.  
  680. Private Sub TestSetAllBits()
  681.    
  682.    Dim intResult        As Integer
  683.    Dim strResult        As String
  684.    Dim strDisplay       As String
  685.    
  686.    Dim strData          As String
  687.    
  688.    Dim i                As Integer
  689.    
  690.    intResult = 0
  691.    
  692.    strResult = ""
  693.    strDisplay = ""
  694.    
  695.    strData = Text1.Text
  696.    
  697.    Call cSetAllBits(strData, True)
  698.    strDisplay = strDisplay + "Set all bits is " & vbCrLf
  699.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  700.    
  701.    Call cSetAllBits(strData, False)
  702.    strDisplay = strDisplay + "Reset all bits is " & vbCrLf
  703.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  704.    
  705.    txt_Result = strDisplay
  706.  
  707.    'time the function
  708.  
  709.    TimerHandle = cTimerOpen()
  710.    TimerStartOk = cTimerStart(TimerHandle)
  711.    
  712.    For i = 1 To Iteration
  713.       Call cSetAllBits(strData, True)
  714.    Next i
  715.    
  716.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  717.    
  718.    TimerCloseOk = cTimerClose(TimerHandle)
  719.  
  720. End Sub
  721.  
  722. Private Sub TestSetBit()
  723.    
  724.    Dim intResult        As Integer
  725.    Dim strResult        As String
  726.    Dim strDisplay       As String
  727.    
  728.    Dim strData          As String
  729.    
  730.    Dim i                As Integer
  731.    
  732.    intResult = 0
  733.    
  734.    strResult = ""
  735.    strDisplay = ""
  736.    
  737.    strData = Text1.Text
  738.    
  739.    Call cSetBit(strData, 0, True)
  740.    strDisplay = strDisplay + "Set bit '0' is '" & strData & "'" & vbCrLf
  741.    Call cSetBit(strData, 5, True)
  742.    strDisplay = strDisplay + "Set bit '5' is '" & strData & "'" & vbCrLf
  743.    Call cSetBit(strData, 7, True)
  744.    strDisplay = strDisplay + "Set bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  745.    
  746.    Call cSetBit(strData, 0, False)
  747.    strDisplay = strDisplay + "Reset bit '0' is '" & strData & "'" & vbCrLf
  748.    Call cSetBit(strData, 5, False)
  749.    strDisplay = strDisplay + "Reset bit '5' is '" & strData & "'" & vbCrLf
  750.    Call cSetBit(strData, 7, False)
  751.    strDisplay = strDisplay + "Reset bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  752.    
  753.    Call cSetBit(strData, 22, True)
  754.    strDisplay = strDisplay + "Set bit '22' is '" & strData & "'" & vbCrLf
  755.    Call cSetBit(strData, 30, True)
  756.    strDisplay = strDisplay + "Set bit '30' is '" & strData & "'" & vbCrLf
  757.    Call cSetBit(strData, 38, True)
  758.    strDisplay = strDisplay + "Set bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  759.    
  760.    Call cSetBit(strData, 22, False)
  761.    strDisplay = strDisplay + "Reset bit '22' is '" & strData & "'" & vbCrLf
  762.    Call cSetBit(strData, 30, False)
  763.    strDisplay = strDisplay + "Reset bit '30' is '" & strData & "'" & vbCrLf
  764.    Call cSetBit(strData, 38, False)
  765.    strDisplay = strDisplay + "Reset bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  766.    
  767.    txt_Result = strDisplay
  768.  
  769.    'time the function
  770.  
  771.    TimerHandle = cTimerOpen()
  772.    TimerStartOk = cTimerStart(TimerHandle)
  773.    
  774.    For i = 1 To Iteration
  775.       Call cSetBit(strData, 0, True)
  776.    Next i
  777.    
  778.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  779.    
  780.    TimerCloseOk = cTimerClose(TimerHandle)
  781.  
  782. End Sub
  783.  
  784. Private Sub TestToggleAllBits()
  785.    
  786.    Dim intResult        As Integer
  787.    Dim strResult        As String
  788.    Dim strDisplay       As String
  789.    
  790.    Dim strData          As String
  791.    
  792.    Dim i                As Integer
  793.    
  794.    intResult = 0
  795.    
  796.    strResult = ""
  797.    strDisplay = ""
  798.    
  799.    strData = Text1.Text
  800.    
  801.    Call cToggleAllBits(strData)
  802.    strDisplay = strDisplay + "Toggle all bits is " & vbCrLf
  803.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  804.    
  805.    Call cToggleAllBits(strData)
  806.    strDisplay = strDisplay + "Toggle all bits of the toggled is " & vbCrLf
  807.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  808.    
  809.    txt_Result = strDisplay
  810.  
  811.    'time the function
  812.  
  813.    TimerHandle = cTimerOpen()
  814.    TimerStartOk = cTimerStart(TimerHandle)
  815.    
  816.    For i = 1 To Iteration
  817.       Call cToggleAllBits(strData)
  818.    Next i
  819.    
  820.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  821.    
  822.    TimerCloseOk = cTimerClose(TimerHandle)
  823.  
  824. End Sub
  825.  
  826. Private Sub TestToggleBit()
  827.    
  828.    Dim intResult        As Integer
  829.    Dim strResult        As String
  830.    Dim strDisplay       As String
  831.    
  832.    Dim strData          As String
  833.    
  834.    Dim i                As Integer
  835.    
  836.    intResult = 0
  837.    
  838.    strResult = ""
  839.    strDisplay = ""
  840.    
  841.    strData = Text1.Text
  842.    
  843.    Call cToggleBit(strData, 0)
  844.    strDisplay = strDisplay + "Toggle bit '0' is '" & strData & "'" & vbCrLf
  845.    Call cToggleBit(strData, 5)
  846.    strDisplay = strDisplay + "Toggle bit '5' is '" & strData & "'" & vbCrLf
  847.    Call cToggleBit(strData, 7)
  848.    strDisplay = strDisplay + "Toggle bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  849.    
  850.    Call cToggleBit(strData, 0)
  851.    strDisplay = strDisplay + "Toggle bit '0' is '" & strData & "'" & vbCrLf
  852.    Call cToggleBit(strData, 5)
  853.    strDisplay = strDisplay + "Toggle bit '5' is '" & strData & "'" & vbCrLf
  854.    Call cToggleBit(strData, 7)
  855.    strDisplay = strDisplay + "Toggle bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  856.    
  857.    Call cToggleBit(strData, 22)
  858.    strDisplay = strDisplay + "Toggle bit '22' is '" & strData & "'" & vbCrLf
  859.    Call cToggleBit(strData, 30)
  860.    strDisplay = strDisplay + "Toggle bit '30' is '" & strData & "'" & vbCrLf
  861.    Call cToggleBit(strData, 38)
  862.    strDisplay = strDisplay + "Toggle bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  863.    
  864.    Call cToggleBit(strData, 22)
  865.    strDisplay = strDisplay + "Toggle bit '22' is '" & strData & "'" & vbCrLf
  866.    Call cToggleBit(strData, 30)
  867.    strDisplay = strDisplay + "Toggle bit '30' is '" & strData & "'" & vbCrLf
  868.    Call cToggleBit(strData, 38)
  869.    strDisplay = strDisplay + "Toggle bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  870.    
  871.    txt_Result = strDisplay
  872.  
  873.    'time the function
  874.  
  875.    TimerHandle = cTimerOpen()
  876.    TimerStartOk = cTimerStart(TimerHandle)
  877.    
  878.    For i = 1 To Iteration
  879.       Call cToggleBit(strData, 0)
  880.    Next i
  881.    
  882.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  883.    
  884.    TimerCloseOk = cTimerClose(TimerHandle)
  885.  
  886. End Sub
  887.  
  888. Private Sub TestGetBitValue()
  889.    
  890.    Dim intResult        As Integer
  891.    Dim strResult        As String
  892.    Dim strDisplay       As String
  893.    
  894.    Dim bData            As Byte
  895.    Dim iData            As Integer
  896.    Dim lData            As Long
  897.    Dim sData            As Single
  898.    Dim dData            As Double
  899.    
  900.    Dim i                As Integer
  901.    
  902.    intResult = 0
  903.    
  904.    strResult = ""
  905.    strDisplay = ""
  906.    
  907.    Call cRndInit(-1)
  908.    
  909.    bData = (Abs(cRndI()) Mod 256)
  910.    iData = Abs(cRndI())
  911.    lData = Abs(cRndL())
  912.    sData = Abs(cRndS())
  913.    dData = Abs(cRndD())
  914.      
  915.    strDisplay = strDisplay + "Byte value : " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  916.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitB(bData, 0), "set", "reset") & vbCrLf
  917.    strDisplay = strDisplay + "   bit 1 is " & IIf(cGetBitB(bData, 1), "set", "reset") & vbCrLf
  918.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitB(bData, 3), "set", "reset") & vbCrLf
  919.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitB(bData, 5), "set", "reset") & vbCrLf
  920.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitB(bData, 7), "set", "reset") & vbCrLf & vbCrLf
  921.    
  922.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  923.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitI(iData, 0), "set", "reset") & vbCrLf
  924.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitI(iData, 3), "set", "reset") & vbCrLf
  925.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitI(iData, 7), "set", "reset") & vbCrLf
  926.    strDisplay = strDisplay + "   bit 11 is " & IIf(cGetBitI(iData, 11), "set", "reset") & vbCrLf
  927.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitI(iData, 15), "set", "reset") & vbCrLf & vbCrLf
  928.    
  929.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  930.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitL(lData, 0), "set", "reset") & vbCrLf
  931.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitL(lData, 5), "set", "reset") & vbCrLf
  932.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitL(lData, 10), "set", "reset") & vbCrLf
  933.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitL(lData, 15), "set", "reset") & vbCrLf
  934.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitL(lData, 20), "set", "reset") & vbCrLf & vbCrLf
  935.    
  936.    strDisplay = strDisplay + "Single value : " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  937.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitS(sData, 0), "set", "reset") & vbCrLf
  938.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitS(sData, 5), "set", "reset") & vbCrLf
  939.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitS(sData, 10), "set", "reset") & vbCrLf
  940.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitS(sData, 15), "set", "reset") & vbCrLf
  941.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitS(sData, 20), "set", "reset") & vbCrLf & vbCrLf
  942.    
  943.    strDisplay = strDisplay + "Double value : " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  944.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitD(dData, 0), "set", "reset") & vbCrLf
  945.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitD(dData, 10), "set", "reset") & vbCrLf
  946.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitD(dData, 20), "set", "reset") & vbCrLf
  947.    strDisplay = strDisplay + "   bit 30 is " & IIf(cGetBitD(dData, 30), "set", "reset") & vbCrLf
  948.    strDisplay = strDisplay + "   bit 40 is " & IIf(cGetBitD(dData, 40), "set", "reset") & vbCrLf & vbCrLf
  949.    
  950.    txt_Result = strDisplay
  951.  
  952.    'time the function
  953.  
  954.    TimerHandle = cTimerOpen()
  955.    TimerStartOk = cTimerStart(TimerHandle)
  956.    
  957.    For i = 1 To Iteration
  958.       intResult = cGetBitI(iData, i)
  959.    Next i
  960.    
  961.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  962.    
  963.    TimerCloseOk = cTimerClose(TimerHandle)
  964.  
  965. End Sub
  966. Private Sub TestGetBit2Value()
  967.    
  968.    Dim intResult        As Integer
  969.    Dim strResult        As String
  970.    Dim strDisplay       As String
  971.    
  972.    Dim iData            As Integer
  973.    Dim lData            As Long
  974.    
  975.    Dim i                As Integer
  976.    
  977.    intResult = 0
  978.    
  979.    strResult = ""
  980.    strDisplay = ""
  981.    
  982.    Call cRndInit(-1)
  983.    
  984.    iData = Abs(cRndI())
  985.    lData = Abs(cRndL())
  986.      
  987.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  988.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitI2(iData, 0), "set", "reset") & vbCrLf
  989.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitI2(iData, 3), "set", "reset") & vbCrLf
  990.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitI2(iData, 7), "set", "reset") & vbCrLf
  991.    strDisplay = strDisplay + "   bit 11 is " & IIf(cGetBitI2(iData, 11), "set", "reset") & vbCrLf
  992.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitI2(iData, 15), "set", "reset") & vbCrLf & vbCrLf
  993.    
  994.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  995.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitL2(lData, 0), "set", "reset") & vbCrLf
  996.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitL2(lData, 5), "set", "reset") & vbCrLf
  997.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitL2(lData, 10), "set", "reset") & vbCrLf
  998.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitL2(lData, 15), "set", "reset") & vbCrLf
  999.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitL2(lData, 20), "set", "reset") & vbCrLf & vbCrLf
  1000.    
  1001.    txt_Result = strDisplay
  1002.  
  1003.    'time the function
  1004.  
  1005.    TimerHandle = cTimerOpen()
  1006.    TimerStartOk = cTimerStart(TimerHandle)
  1007.    
  1008.    For i = 1 To Iteration
  1009.       intResult = cGetBitI2(iData, i)
  1010.    Next i
  1011.    
  1012.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1013.    
  1014.    TimerCloseOk = cTimerClose(TimerHandle)
  1015.  
  1016. End Sub
  1017.  
  1018. Private Sub TestSetBitValue()
  1019.    
  1020.    Dim intResult        As Integer
  1021.    Dim strResult        As String
  1022.    Dim strDisplay       As String
  1023.    
  1024.    Dim bData            As Byte
  1025.    Dim iData            As Integer
  1026.    Dim lData            As Long
  1027.    Dim sData            As Single
  1028.    Dim dData            As Double
  1029.    
  1030.    Dim i                As Integer
  1031.    
  1032.    intResult = 0
  1033.    
  1034.    strResult = ""
  1035.    strDisplay = ""
  1036.    
  1037.    bData = (Abs(cRndI()) Mod 256)
  1038.    iData = Abs(cRndI())
  1039.    lData = Abs(cRndL())
  1040.    sData = Abs(cRndS())
  1041.    dData = Abs(cRndD())
  1042.      
  1043.    strDisplay = strDisplay + "Byte value : " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1044.    Call cSetBitB(bData, 0, True)
  1045.    strDisplay = strDisplay + "   set bit 0 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1046.    Call cSetBitB(bData, 3, False)
  1047.    strDisplay = strDisplay + "   reset bit 3 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1048.    Call cSetBitB(bData, 5, True)
  1049.    strDisplay = strDisplay + "   set bit 5 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf & vbCrLf
  1050.    
  1051.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1052.    Call cSetBitI(iData, 3, True)
  1053.    strDisplay = strDisplay + "   set bit 3 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1054.    Call cSetBitI(iData, 6, False)
  1055.    strDisplay = strDisplay + "   reset bit 6 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1056.    Call cSetBitI(iData, 9, True)
  1057.    strDisplay = strDisplay + "   set bit 9 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf & vbCrLf
  1058.    
  1059.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1060.    Call cSetBitL(lData, 6, True)
  1061.    strDisplay = strDisplay + "   set bit 6 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1062.    Call cSetBitL(lData, 12, False)
  1063.    strDisplay = strDisplay + "   reset bit 12 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1064.    Call cSetBitL(lData, 24, True)
  1065.    strDisplay = strDisplay + "   set bit 24 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf & vbCrLf
  1066.    
  1067.    strDisplay = strDisplay + "Single value : " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1068.    Call cSetBitS(sData, 0, True)
  1069.    strDisplay = strDisplay + "   set bit 0 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1070.    Call cSetBitS(sData, 3, True)
  1071.    strDisplay = strDisplay + "   set bit 3 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1072.    Call cSetBitS(sData, 6, True)
  1073.    strDisplay = strDisplay + "   set bit 6 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1074.    Call cSetBitS(sData, 12, True)
  1075.    strDisplay = strDisplay + "   set bit 12 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1076.    Call cSetBitS(sData, 24, True)
  1077.    strDisplay = strDisplay + "   set bit 24 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf & vbCrLf
  1078.    
  1079.    strDisplay = strDisplay + "Double value : " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1080.    Call cSetBitD(dData, 0, False)
  1081.    strDisplay = strDisplay + "   reset bit 0 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1082.    Call cSetBitD(dData, 3, False)
  1083.    strDisplay = strDisplay + "   reset bit 3 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1084.    Call cSetBitD(dData, 12, False)
  1085.    strDisplay = strDisplay + "   reset bit 12 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1086.    Call cSetBitD(dData, 24, False)
  1087.    strDisplay = strDisplay + "   reset bit 24 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1088.    Call cSetBitD(dData, 48, False)
  1089.    strDisplay = strDisplay + "   reset bit 48 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf & vbCrLf
  1090.    
  1091.    txt_Result = strDisplay
  1092.  
  1093.    'time the function
  1094.  
  1095.    TimerHandle = cTimerOpen()
  1096.    TimerStartOk = cTimerStart(TimerHandle)
  1097.    
  1098.    For i = 1 To Iteration
  1099.       Call cSetBitI(iData, 0, True)
  1100.    Next i
  1101.    
  1102.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1103.    
  1104.    TimerCloseOk = cTimerClose(TimerHandle)
  1105.  
  1106. End Sub
  1107.  
  1108. Private Sub TestSetBit2Value()
  1109.    
  1110.    Dim intResult        As Integer
  1111.    Dim strResult        As String
  1112.    Dim strDisplay       As String
  1113.    
  1114.    Dim iData            As Integer
  1115.    Dim lData            As Long
  1116.    
  1117.    Dim i                As Integer
  1118.    
  1119.    intResult = 0
  1120.    
  1121.    strResult = ""
  1122.    strDisplay = ""
  1123.    
  1124.    iData = Abs(cRndI())
  1125.    lData = Abs(cRndL())
  1126.      
  1127.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1128.    Call cSetBitI2(iData, 3, True)
  1129.    strDisplay = strDisplay + "   set bit 3 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1130.    Call cSetBitI2(iData, 6, False)
  1131.    strDisplay = strDisplay + "   reset bit 6 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1132.    Call cSetBitI2(iData, 9, True)
  1133.    strDisplay = strDisplay + "   set bit 9 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf & vbCrLf
  1134.    
  1135.    strDisplay = strDisplay + "Long value : " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1136.    Call cSetBitL2(lData, 6, True)
  1137.    strDisplay = strDisplay + "   set bit 6 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1138.    Call cSetBitL2(lData, 12, False)
  1139.    strDisplay = strDisplay + "   reset bit 12 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1140.    Call cSetBitL2(lData, 24, True)
  1141.    strDisplay = strDisplay + "   set bit 24 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf & vbCrLf
  1142.    
  1143.    txt_Result = strDisplay
  1144.  
  1145.    'time the function
  1146.  
  1147.    TimerHandle = cTimerOpen()
  1148.    TimerStartOk = cTimerStart(TimerHandle)
  1149.    
  1150.    For i = 1 To Iteration
  1151.       Call cSetBitI2(iData, 0, True)
  1152.    Next i
  1153.    
  1154.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1155.    
  1156.    TimerCloseOk = cTimerClose(TimerHandle)
  1157.  
  1158. End Sub
  1159.  
  1160. Private Sub TestB2I()
  1161.    
  1162.    Dim lResult          As Long
  1163.    Dim strResult        As String
  1164.    Dim strDisplay       As String
  1165.    
  1166.    Dim i                As Integer
  1167.    
  1168.    Dim i1               As String
  1169.    Dim i2               As String
  1170.    Dim l1               As String
  1171.    Dim l2               As String
  1172.    
  1173.    i1 = "1010101010101010"
  1174.    i2 = "0101010101010101"
  1175.    
  1176.    l1 = "10101010101010101010101010101010"
  1177.    l2 = "01010101010101010101010101010101"
  1178.    
  1179.    lResult = 0
  1180.    
  1181.    strResult = ""
  1182.    strDisplay = ""
  1183.      
  1184.    strDisplay = strDisplay & "B2I of " & i1 & " is " & cB2I(i1) & vbCrLf
  1185.    strDisplay = strDisplay & "B2I of " & i2 & " is " & cB2I(i2) & vbCrLf & vbCrLf
  1186.    
  1187.    strDisplay = strDisplay & "I2B of " & cB2I(i1) & " is " & cI2B(cB2I(i1)) & vbCrLf
  1188.    strDisplay = strDisplay & "I2B of " & cB2I(i2) & " is " & cI2B(cB2I(i2)) & vbCrLf & vbCrLf
  1189.    
  1190.    strDisplay = strDisplay & "I2Bext (bin = x0) of " & cB2I(i1) & " is " & cI2Bext(cB2I(i1), "x0") & vbCrLf
  1191.    strDisplay = strDisplay & "I2Bext (bin = x0) of " & cB2I(i2) & " is " & cI2Bext(cB2I(i2), "x0") & vbCrLf & vbCrLf
  1192.    
  1193.    strDisplay = strDisplay & "B2L of " & l1 & " is " & cB2L(l1) & vbCrLf
  1194.    strDisplay = strDisplay & "B2L of " & l2 & " is " & cB2L(l2) & vbCrLf & vbCrLf
  1195.    
  1196.    strDisplay = strDisplay & "L2B of " & cB2L(l1) & " is " & cL2B(cB2L(l1)) & vbCrLf
  1197.    strDisplay = strDisplay & "L2B of " & cB2L(l2) & " is " & cL2B(cB2L(l2)) & vbCrLf & vbCrLf
  1198.    
  1199.    strDisplay = strDisplay & "L2Bext (bin = x0) of " & cB2L(l1) & " is " & cL2Bext(cB2L(l1), "x0") & vbCrLf
  1200.    strDisplay = strDisplay & "L2Bext (bin = x0) of " & cB2L(l2) & " is " & cL2Bext(cB2L(l2), "x0") & vbCrLf & vbCrLf
  1201.    
  1202.    txt_Result = strDisplay
  1203.  
  1204.    'time the function
  1205.  
  1206.    TimerHandle = cTimerOpen()
  1207.    TimerStartOk = cTimerStart(TimerHandle)
  1208.    
  1209.    For i = 1 To Iteration
  1210.       strResult = cB2I(12345)
  1211.    Next i
  1212.    
  1213.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1214.    
  1215.    TimerCloseOk = cTimerClose(TimerHandle)
  1216.  
  1217. End Sub
  1218.