home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / LVB / T2W32523.ZIP / _BITSTR.FRM < prev    next >
Text File  |  1998-04-07  |  38KB  |  1,209 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.          TestB2I
  271.       Case 15
  272.          SSPanel2.Visible = False
  273.          Call TestGetBit2Value
  274.       Case 16
  275.          SSPanel2.Visible = False
  276.          Call TestSetBit2Value
  277.    End Select
  278.  
  279.    DoEvents
  280.    Call cEnableFI(mdiT2W.Picture1)
  281.    
  282. End Sub
  283.  
  284.  
  285. Private Sub cmdNP_Click(Index As Integer)
  286.  
  287.    Call sub_NextPrev(cmb_Function, Index)
  288.  
  289. End Sub
  290.  
  291. Private Sub Form_Activate()
  292.  
  293.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  294.  
  295. End Sub
  296.  
  297. Private Sub Form_Load()
  298.  
  299.    IsLoaded = False
  300.    
  301.    Show
  302.  
  303.    Text1.Text = Text1.Tag + LCase$(Text1.Tag)
  304.  
  305.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_bitstr.t2w")
  306.    
  307.    IsLoaded = True
  308.    
  309. End Sub
  310.  
  311. Private Sub SSCommand1_Click()
  312.    
  313.    Call cmb_Function_Click
  314.    
  315. End Sub
  316.  
  317.  
  318.  
  319.  
  320. Private Sub TestCreateBits()
  321.    
  322.    Dim intResult        As Integer
  323.    Dim strResult        As String
  324.    Dim strDisplay       As String
  325.    
  326.    Dim i                As Integer
  327.    
  328.    intResult = 0
  329.    
  330.    strResult = ""
  331.    strDisplay = ""
  332.      
  333.    strResult = cCreateBits(1024)
  334.    strDisplay = strDisplay + "Create a bit string for 1024 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  335.    
  336.    strResult = cCreateBits(512)
  337.    strDisplay = strDisplay + "Create a bit string for 512 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  338.  
  339.    strResult = cCreateBits(33)
  340.    strDisplay = strDisplay + "Create a bit string for 33 bits is '" & Len(strResult) & "' bytes" & vbCrLf & vbCrLf
  341.  
  342.    strResult = cCreateBits(1)
  343.    strDisplay = strDisplay + "Create a bit string for 1 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.    txt_Result = strDisplay
  349.  
  350.    'time the function
  351.  
  352.    TimerHandle = cTimerOpen()
  353.    TimerStartOk = cTimerStart(TimerHandle)
  354.    
  355.    For i = 1 To Iteration
  356.       strResult = cCreateBits(1024)
  357.    Next i
  358.    
  359.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  360.    
  361.    TimerCloseOk = cTimerClose(TimerHandle)
  362.  
  363. End Sub
  364.  
  365.  
  366.  
  367.  
  368. Private Sub TestFindBitReset()
  369.    
  370.    Dim intResult        As Integer
  371.    Dim strResult        As String
  372.    Dim strDisplay       As String
  373.    
  374.    Dim strData          As String
  375.    
  376.    Dim i                As Integer
  377.    
  378.    intResult = 0
  379.    
  380.    strResult = ""
  381.    strDisplay = ""
  382.      
  383.    strData = Text1.Text
  384.    
  385.    strDisplay = strDisplay + "The following bits are Reset (False) " & vbCrLf & vbCrLf
  386.    
  387.    intResult = True
  388.    
  389.    Do
  390.       intResult = cFindBitReset(strData, intResult)
  391.       If (intResult <> True) Then strDisplay = strDisplay & intResult & ", "
  392.    Loop Until (intResult = True)
  393.    
  394.    strDisplay = Left$(strDisplay, Len(strDisplay) - 1)
  395.    
  396.    strDisplay = strDisplay & vbCrLf & vbCrLf
  397.  
  398.    txt_Result = strDisplay
  399.  
  400.    'time the function
  401.  
  402.    TimerHandle = cTimerOpen()
  403.    TimerStartOk = cTimerStart(TimerHandle)
  404.    
  405.    For i = 1 To Iteration
  406.       intResult = cFindBitReset(strData, i)
  407.    Next i
  408.    
  409.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  410.    
  411.    TimerCloseOk = cTimerClose(TimerHandle)
  412.  
  413. End Sub
  414.  
  415. Private Sub SSCommand2_Click()
  416.    
  417.    Text1.Text = Text1.Tag + LCase$(Text1.Tag)
  418.    
  419.    Call SSCommand1_Click
  420.    
  421. End Sub
  422.  
  423.  
  424.  
  425. Private Sub TestFindBitSet()
  426.    
  427.    Dim intResult        As Integer
  428.    Dim strResult        As String
  429.    Dim strDisplay       As String
  430.    
  431.    Dim strData          As String
  432.    
  433.    Dim i                As Integer
  434.    
  435.    intResult = 0
  436.    
  437.    strResult = ""
  438.    strDisplay = ""
  439.      
  440.    strData = Text1.Text
  441.    
  442.    strDisplay = strDisplay + "The following bits are Set (True) " & vbCrLf & vbCrLf
  443.    
  444.    intResult = True
  445.    
  446.    Do
  447.       intResult = cFindBitSet(strData, intResult)
  448.       If (intResult <> True) Then strDisplay = strDisplay & intResult & ", "
  449.    Loop Until (intResult = True)
  450.    
  451.    strDisplay = Left$(strDisplay, Len(strDisplay) - 1)
  452.    
  453.    strDisplay = strDisplay & vbCrLf & vbCrLf
  454.  
  455.    txt_Result = strDisplay
  456.  
  457.    'time the function
  458.  
  459.    TimerHandle = cTimerOpen()
  460.    TimerStartOk = cTimerStart(TimerHandle)
  461.    
  462.    For i = 1 To Iteration
  463.       intResult = cFindBitSet(strData, i)
  464.    Next i
  465.    
  466.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  467.    
  468.    TimerCloseOk = cTimerClose(TimerHandle)
  469.  
  470. End Sub
  471.  
  472. Private Sub TestGetBit()
  473.    
  474.    Dim intResult        As Integer
  475.    Dim strResult        As String
  476.    Dim strDisplay       As String
  477.    
  478.    Dim strData          As String
  479.    
  480.    Dim i                As Integer
  481.    
  482.    intResult = 0
  483.    
  484.    strResult = ""
  485.    strDisplay = ""
  486.      
  487.    strData = Text1.Text
  488.    
  489.    strDisplay = strDisplay + "Bit '1' is '" & IIf(cGetBit(strData, 1), "set", "reset") & "'" & vbCrLf
  490.    strDisplay = strDisplay + "Bit '3' is '" & IIf(cGetBit(strData, 3), "set", "reset") & "'" & vbCrLf
  491.    strDisplay = strDisplay + "Bit '5' is '" & IIf(cGetBit(strData, 5), "set", "reset") & "'" & vbCrLf
  492.    strDisplay = strDisplay + "Bit '7' is '" & IIf(cGetBit(strData, 7), "set", "reset") & "'" & vbCrLf
  493.    strDisplay = strDisplay + "Bit '100' is '" & IIf(cGetBit(strData, 100), "set", "reset") & "'" & vbCrLf
  494.    strDisplay = strDisplay + "Bit '102' is '" & IIf(cGetBit(strData, 102), "set", "reset") & "'" & vbCrLf
  495.    strDisplay = strDisplay + "Bit '104' is '" & IIf(cGetBit(strData, 104), "set", "reset") & "'" & vbCrLf
  496.    strDisplay = strDisplay + "Bit '106' is '" & IIf(cGetBit(strData, 106), "set", "reset") & "'" & vbCrLf
  497.    
  498.    
  499.    txt_Result = strDisplay
  500.  
  501.    'time the function
  502.  
  503.    TimerHandle = cTimerOpen()
  504.    TimerStartOk = cTimerStart(TimerHandle)
  505.    
  506.    For i = 1 To Iteration
  507.       intResult = cGetBit(strData, i)
  508.    Next i
  509.    
  510.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  511.    
  512.    TimerCloseOk = cTimerClose(TimerHandle)
  513.  
  514. End Sub
  515.  
  516. Private Sub TestGiveBitPalindrome()
  517.    
  518.    Dim intResult        As Integer
  519.    Dim strResult        As String
  520.    Dim strDisplay       As String
  521.    
  522.    Dim strData          As String
  523.    
  524.    Dim i                As Integer
  525.    
  526.    intResult = 0
  527.    
  528.    strResult = ""
  529.    strDisplay = ""
  530.      
  531.    strResult = cGiveBitPalindrome()
  532.    
  533.    strDisplay = strDisplay + "The followings chars are Bit Palindrome : " & vbCrLf & vbCrLf
  534.    strDisplay = strDisplay + "chr(0) and  " & cBlockCharFromRight(cGiveBitPalindrome(), 1)
  535.    
  536.    txt_Result = strDisplay
  537.  
  538.    'time the function
  539.  
  540.    TimerHandle = cTimerOpen()
  541.    TimerStartOk = cTimerStart(TimerHandle)
  542.    
  543.    For i = 1 To Iteration
  544.       strResult = cGiveBitPalindrome()
  545.    Next i
  546.    
  547.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  548.    
  549.    TimerCloseOk = cTimerClose(TimerHandle)
  550.  
  551. End Sub
  552.  
  553. Private Sub TestIsBitPalindrome()
  554.    
  555.    Dim intResult        As Integer
  556.    Dim strResult        As String
  557.    Dim strDisplay       As String
  558.    
  559.    Dim strData          As String
  560.    
  561.    Dim i                As Integer
  562.    
  563.    intResult = 0
  564.    
  565.    strResult = ""
  566.    strDisplay = ""
  567.    
  568.    strData = Text1.Text
  569.      
  570.    intResult = cIsBitPalindrome(strData)
  571.    
  572.    strDisplay = strDisplay + "Test string is " & IIf(intResult, "", "not ") & "Bit Palindrome " & vbCrLf & vbCrLf
  573.    
  574.    strDisplay = strDisplay + "The followings chars are Bit Palindrome : " & vbCrLf
  575.    
  576.    For i = 1 To 255
  577.       If cIsBitPalindrome(Chr$(i)) Then strDisplay = strDisplay + Chr$(i) & " (" & i & ") "
  578.    Next i
  579.  
  580.    txt_Result = strDisplay
  581.  
  582.    'time the function
  583.  
  584.    TimerHandle = cTimerOpen()
  585.    TimerStartOk = cTimerStart(TimerHandle)
  586.    
  587.    For i = 1 To Iteration
  588.       intResult = cIsBitPalindrome(strData)
  589.    Next i
  590.    
  591.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  592.    
  593.    TimerCloseOk = cTimerClose(TimerHandle)
  594.  
  595. End Sub
  596.  
  597. Private Sub TestReverseAllBits()
  598.    
  599.    Dim intResult        As Integer
  600.    Dim strResult        As String
  601.    Dim strDisplay       As String
  602.    
  603.    Dim strData          As String
  604.    
  605.    Dim i                As Integer
  606.    
  607.    intResult = 0
  608.    
  609.    strResult = ""
  610.    strDisplay = ""
  611.    
  612.    strData = Text1.Text
  613.      
  614.    Call cReverseAllBits(strData)
  615.    strDisplay = strDisplay + "Reverse all bits is " & vbCrLf & strData & vbCrLf & vbCrLf
  616.    
  617.    Call cReverseAllBits(strData)
  618.    strDisplay = strDisplay + "Reverse all bits of the reversed is " & vbCrLf & strData & vbCrLf & vbCrLf
  619.    
  620.    txt_Result = strDisplay
  621.  
  622.    'time the function
  623.  
  624.    TimerHandle = cTimerOpen()
  625.    TimerStartOk = cTimerStart(TimerHandle)
  626.    
  627.    For i = 1 To Iteration
  628.       Call cReverseAllBits(strData)
  629.    Next i
  630.    
  631.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  632.    
  633.    TimerCloseOk = cTimerClose(TimerHandle)
  634.  
  635. End Sub
  636.  
  637. Private Sub TestReverseAllBitsByChar()
  638.    
  639.    Dim intResult        As Integer
  640.    Dim strResult        As String
  641.    Dim strDisplay       As String
  642.    
  643.    Dim strData          As String
  644.    
  645.    Dim i                As Integer
  646.    
  647.    intResult = 0
  648.    
  649.    strResult = ""
  650.    strDisplay = ""
  651.    
  652.    strData = Text1.Text
  653.      
  654.    Call cReverseAllBitsByChar(strData)
  655.    strDisplay = strDisplay + "Reverse all bits by char is " & vbCrLf & strData & vbCrLf & vbCrLf
  656.    
  657.    Call cReverseAllBitsByChar(strData)
  658.    strDisplay = strDisplay + "Reverse all bits by char of the reversed is " & vbCrLf & strData & vbCrLf & vbCrLf
  659.    
  660.    txt_Result = strDisplay
  661.  
  662.    'time the function
  663.  
  664.    TimerHandle = cTimerOpen()
  665.    TimerStartOk = cTimerStart(TimerHandle)
  666.    
  667.    For i = 1 To Iteration
  668.       Call cReverseAllBitsByChar(strData)
  669.    Next i
  670.    
  671.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  672.    
  673.    TimerCloseOk = cTimerClose(TimerHandle)
  674.  
  675. End Sub
  676.  
  677. Private Sub TestSetAllBits()
  678.    
  679.    Dim intResult        As Integer
  680.    Dim strResult        As String
  681.    Dim strDisplay       As String
  682.    
  683.    Dim strData          As String
  684.    
  685.    Dim i                As Integer
  686.    
  687.    intResult = 0
  688.    
  689.    strResult = ""
  690.    strDisplay = ""
  691.    
  692.    strData = Text1.Text
  693.    
  694.    Call cSetAllBits(strData, True)
  695.    strDisplay = strDisplay + "Set all bits is " & vbCrLf
  696.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  697.    
  698.    Call cSetAllBits(strData, False)
  699.    strDisplay = strDisplay + "Reset all bits is " & vbCrLf
  700.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  701.    
  702.    txt_Result = strDisplay
  703.  
  704.    'time the function
  705.  
  706.    TimerHandle = cTimerOpen()
  707.    TimerStartOk = cTimerStart(TimerHandle)
  708.    
  709.    For i = 1 To Iteration
  710.       Call cSetAllBits(strData, True)
  711.    Next i
  712.    
  713.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  714.    
  715.    TimerCloseOk = cTimerClose(TimerHandle)
  716.  
  717. End Sub
  718.  
  719. Private Sub TestSetBit()
  720.    
  721.    Dim intResult        As Integer
  722.    Dim strResult        As String
  723.    Dim strDisplay       As String
  724.    
  725.    Dim strData          As String
  726.    
  727.    Dim i                As Integer
  728.    
  729.    intResult = 0
  730.    
  731.    strResult = ""
  732.    strDisplay = ""
  733.    
  734.    strData = Text1.Text
  735.    
  736.    Call cSetBit(strData, 0, True)
  737.    strDisplay = strDisplay + "Set bit '0' is '" & strData & "'" & vbCrLf
  738.    Call cSetBit(strData, 5, True)
  739.    strDisplay = strDisplay + "Set bit '5' is '" & strData & "'" & vbCrLf
  740.    Call cSetBit(strData, 7, True)
  741.    strDisplay = strDisplay + "Set bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  742.    
  743.    Call cSetBit(strData, 0, False)
  744.    strDisplay = strDisplay + "Reset bit '0' is '" & strData & "'" & vbCrLf
  745.    Call cSetBit(strData, 5, False)
  746.    strDisplay = strDisplay + "Reset bit '5' is '" & strData & "'" & vbCrLf
  747.    Call cSetBit(strData, 7, False)
  748.    strDisplay = strDisplay + "Reset bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  749.    
  750.    Call cSetBit(strData, 22, True)
  751.    strDisplay = strDisplay + "Set bit '22' is '" & strData & "'" & vbCrLf
  752.    Call cSetBit(strData, 30, True)
  753.    strDisplay = strDisplay + "Set bit '30' is '" & strData & "'" & vbCrLf
  754.    Call cSetBit(strData, 38, True)
  755.    strDisplay = strDisplay + "Set bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  756.    
  757.    Call cSetBit(strData, 22, False)
  758.    strDisplay = strDisplay + "Reset bit '22' is '" & strData & "'" & vbCrLf
  759.    Call cSetBit(strData, 30, False)
  760.    strDisplay = strDisplay + "Reset bit '30' is '" & strData & "'" & vbCrLf
  761.    Call cSetBit(strData, 38, False)
  762.    strDisplay = strDisplay + "Reset bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  763.    
  764.    txt_Result = strDisplay
  765.  
  766.    'time the function
  767.  
  768.    TimerHandle = cTimerOpen()
  769.    TimerStartOk = cTimerStart(TimerHandle)
  770.    
  771.    For i = 1 To Iteration
  772.       Call cSetBit(strData, 0, True)
  773.    Next i
  774.    
  775.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  776.    
  777.    TimerCloseOk = cTimerClose(TimerHandle)
  778.  
  779. End Sub
  780.  
  781. Private Sub TestToggleAllBits()
  782.    
  783.    Dim intResult        As Integer
  784.    Dim strResult        As String
  785.    Dim strDisplay       As String
  786.    
  787.    Dim strData          As String
  788.    
  789.    Dim i                As Integer
  790.    
  791.    intResult = 0
  792.    
  793.    strResult = ""
  794.    strDisplay = ""
  795.    
  796.    strData = Text1.Text
  797.    
  798.    Call cToggleAllBits(strData)
  799.    strDisplay = strDisplay + "Toggle all bits is " & vbCrLf
  800.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  801.    
  802.    Call cToggleAllBits(strData)
  803.    strDisplay = strDisplay + "Toggle all bits of the toggled is " & vbCrLf
  804.    strDisplay = strDisplay + strData & vbCrLf & vbCrLf
  805.    
  806.    txt_Result = strDisplay
  807.  
  808.    'time the function
  809.  
  810.    TimerHandle = cTimerOpen()
  811.    TimerStartOk = cTimerStart(TimerHandle)
  812.    
  813.    For i = 1 To Iteration
  814.       Call cToggleAllBits(strData)
  815.    Next i
  816.    
  817.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  818.    
  819.    TimerCloseOk = cTimerClose(TimerHandle)
  820.  
  821. End Sub
  822.  
  823. Private Sub TestToggleBit()
  824.    
  825.    Dim intResult        As Integer
  826.    Dim strResult        As String
  827.    Dim strDisplay       As String
  828.    
  829.    Dim strData          As String
  830.    
  831.    Dim i                As Integer
  832.    
  833.    intResult = 0
  834.    
  835.    strResult = ""
  836.    strDisplay = ""
  837.    
  838.    strData = Text1.Text
  839.    
  840.    Call cToggleBit(strData, 0)
  841.    strDisplay = strDisplay + "Toggle bit '0' is '" & strData & "'" & vbCrLf
  842.    Call cToggleBit(strData, 5)
  843.    strDisplay = strDisplay + "Toggle bit '5' is '" & strData & "'" & vbCrLf
  844.    Call cToggleBit(strData, 7)
  845.    strDisplay = strDisplay + "Toggle bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  846.    
  847.    Call cToggleBit(strData, 0)
  848.    strDisplay = strDisplay + "Toggle bit '0' is '" & strData & "'" & vbCrLf
  849.    Call cToggleBit(strData, 5)
  850.    strDisplay = strDisplay + "Toggle bit '5' is '" & strData & "'" & vbCrLf
  851.    Call cToggleBit(strData, 7)
  852.    strDisplay = strDisplay + "Toggle bit '7' is '" & strData & "'" & vbCrLf & vbCrLf
  853.    
  854.    Call cToggleBit(strData, 22)
  855.    strDisplay = strDisplay + "Toggle bit '22' is '" & strData & "'" & vbCrLf
  856.    Call cToggleBit(strData, 30)
  857.    strDisplay = strDisplay + "Toggle bit '30' is '" & strData & "'" & vbCrLf
  858.    Call cToggleBit(strData, 38)
  859.    strDisplay = strDisplay + "Toggle bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  860.    
  861.    Call cToggleBit(strData, 22)
  862.    strDisplay = strDisplay + "Toggle bit '22' is '" & strData & "'" & vbCrLf
  863.    Call cToggleBit(strData, 30)
  864.    strDisplay = strDisplay + "Toggle bit '30' is '" & strData & "'" & vbCrLf
  865.    Call cToggleBit(strData, 38)
  866.    strDisplay = strDisplay + "Toggle bit '38' is '" & strData & "'" & vbCrLf & vbCrLf
  867.    
  868.    txt_Result = strDisplay
  869.  
  870.    'time the function
  871.  
  872.    TimerHandle = cTimerOpen()
  873.    TimerStartOk = cTimerStart(TimerHandle)
  874.    
  875.    For i = 1 To Iteration
  876.       Call cToggleBit(strData, 0)
  877.    Next i
  878.    
  879.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  880.    
  881.    TimerCloseOk = cTimerClose(TimerHandle)
  882.  
  883. End Sub
  884.  
  885. Private Sub TestGetBitValue()
  886.    
  887.    Dim intResult        As Integer
  888.    Dim strResult        As String
  889.    Dim strDisplay       As String
  890.    
  891.    Dim bData            As Byte
  892.    Dim iData            As Integer
  893.    Dim lData            As Long
  894.    Dim sData            As Single
  895.    Dim dData            As Double
  896.    
  897.    Dim i                As Integer
  898.    
  899.    intResult = 0
  900.    
  901.    strResult = ""
  902.    strDisplay = ""
  903.    
  904.    Call cRndInit(-1)
  905.    
  906.    bData = (Abs(cRndI()) Mod 256)
  907.    iData = Abs(cRndI())
  908.    lData = Abs(cRndL())
  909.    sData = Abs(cRndS())
  910.    dData = Abs(cRndD())
  911.      
  912.    strDisplay = strDisplay + "Byte value : " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  913.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitB(bData, 0), "set", "reset") & vbCrLf
  914.    strDisplay = strDisplay + "   bit 1 is " & IIf(cGetBitB(bData, 1), "set", "reset") & vbCrLf
  915.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitB(bData, 3), "set", "reset") & vbCrLf
  916.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitB(bData, 5), "set", "reset") & vbCrLf
  917.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitB(bData, 7), "set", "reset") & vbCrLf & vbCrLf
  918.    
  919.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  920.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitI(iData, 0), "set", "reset") & vbCrLf
  921.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitI(iData, 3), "set", "reset") & vbCrLf
  922.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitI(iData, 7), "set", "reset") & vbCrLf
  923.    strDisplay = strDisplay + "   bit 11 is " & IIf(cGetBitI(iData, 11), "set", "reset") & vbCrLf
  924.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitI(iData, 15), "set", "reset") & vbCrLf & vbCrLf
  925.    
  926.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  927.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitL(lData, 0), "set", "reset") & vbCrLf
  928.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitL(lData, 5), "set", "reset") & vbCrLf
  929.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitL(lData, 10), "set", "reset") & vbCrLf
  930.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitL(lData, 15), "set", "reset") & vbCrLf
  931.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitL(lData, 20), "set", "reset") & vbCrLf & vbCrLf
  932.    
  933.    strDisplay = strDisplay + "Single value : " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  934.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitS(sData, 0), "set", "reset") & vbCrLf
  935.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitS(sData, 5), "set", "reset") & vbCrLf
  936.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitS(sData, 10), "set", "reset") & vbCrLf
  937.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitS(sData, 15), "set", "reset") & vbCrLf
  938.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitS(sData, 20), "set", "reset") & vbCrLf & vbCrLf
  939.    
  940.    strDisplay = strDisplay + "Double value : " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  941.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitD(dData, 0), "set", "reset") & vbCrLf
  942.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitD(dData, 10), "set", "reset") & vbCrLf
  943.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitD(dData, 20), "set", "reset") & vbCrLf
  944.    strDisplay = strDisplay + "   bit 30 is " & IIf(cGetBitD(dData, 30), "set", "reset") & vbCrLf
  945.    strDisplay = strDisplay + "   bit 40 is " & IIf(cGetBitD(dData, 40), "set", "reset") & vbCrLf & vbCrLf
  946.    
  947.    txt_Result = strDisplay
  948.  
  949.    'time the function
  950.  
  951.    TimerHandle = cTimerOpen()
  952.    TimerStartOk = cTimerStart(TimerHandle)
  953.    
  954.    For i = 1 To Iteration
  955.       intResult = cGetBitI(iData, i)
  956.    Next i
  957.    
  958.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  959.    
  960.    TimerCloseOk = cTimerClose(TimerHandle)
  961.  
  962. End Sub
  963. Private Sub TestGetBit2Value()
  964.    
  965.    Dim intResult        As Integer
  966.    Dim strResult        As String
  967.    Dim strDisplay       As String
  968.    
  969.    Dim iData            As Integer
  970.    Dim lData            As Long
  971.    
  972.    Dim i                As Integer
  973.    
  974.    intResult = 0
  975.    
  976.    strResult = ""
  977.    strDisplay = ""
  978.    
  979.    Call cRndInit(-1)
  980.    
  981.    iData = Abs(cRndI())
  982.    lData = Abs(cRndL())
  983.      
  984.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  985.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitI2(iData, 0), "set", "reset") & vbCrLf
  986.    strDisplay = strDisplay + "   bit 3 is " & IIf(cGetBitI2(iData, 3), "set", "reset") & vbCrLf
  987.    strDisplay = strDisplay + "   bit 7 is " & IIf(cGetBitI2(iData, 7), "set", "reset") & vbCrLf
  988.    strDisplay = strDisplay + "   bit 11 is " & IIf(cGetBitI2(iData, 11), "set", "reset") & vbCrLf
  989.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitI2(iData, 15), "set", "reset") & vbCrLf & vbCrLf
  990.    
  991.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  992.    strDisplay = strDisplay + "   bit 0 is " & IIf(cGetBitL2(lData, 0), "set", "reset") & vbCrLf
  993.    strDisplay = strDisplay + "   bit 5 is " & IIf(cGetBitL2(lData, 5), "set", "reset") & vbCrLf
  994.    strDisplay = strDisplay + "   bit 10 is " & IIf(cGetBitL2(lData, 10), "set", "reset") & vbCrLf
  995.    strDisplay = strDisplay + "   bit 15 is " & IIf(cGetBitL2(lData, 15), "set", "reset") & vbCrLf
  996.    strDisplay = strDisplay + "   bit 20 is " & IIf(cGetBitL2(lData, 20), "set", "reset") & vbCrLf & vbCrLf
  997.    
  998.    txt_Result = strDisplay
  999.  
  1000.    'time the function
  1001.  
  1002.    TimerHandle = cTimerOpen()
  1003.    TimerStartOk = cTimerStart(TimerHandle)
  1004.    
  1005.    For i = 1 To Iteration
  1006.       intResult = cGetBitI2(iData, i)
  1007.    Next i
  1008.    
  1009.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1010.    
  1011.    TimerCloseOk = cTimerClose(TimerHandle)
  1012.  
  1013. End Sub
  1014.  
  1015. Private Sub TestSetBitValue()
  1016.    
  1017.    Dim intResult        As Integer
  1018.    Dim strResult        As String
  1019.    Dim strDisplay       As String
  1020.    
  1021.    Dim bData            As Byte
  1022.    Dim iData            As Integer
  1023.    Dim lData            As Long
  1024.    Dim sData            As Single
  1025.    Dim dData            As Double
  1026.    
  1027.    Dim i                As Integer
  1028.    
  1029.    intResult = 0
  1030.    
  1031.    strResult = ""
  1032.    strDisplay = ""
  1033.    
  1034.    bData = (Abs(cRndI()) Mod 256)
  1035.    iData = Abs(cRndI())
  1036.    lData = Abs(cRndL())
  1037.    sData = Abs(cRndS())
  1038.    dData = Abs(cRndD())
  1039.      
  1040.    strDisplay = strDisplay + "Byte value : " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1041.    Call cSetBitB(bData, 0, True)
  1042.    strDisplay = strDisplay + "   set bit 0 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1043.    Call cSetBitB(bData, 3, False)
  1044.    strDisplay = strDisplay + "   reset bit 3 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf
  1045.    Call cSetBitB(bData, 5, True)
  1046.    strDisplay = strDisplay + "   set bit 5 is " & bData & " (" & cToBinary(cMKB(bData)) & ")" & vbCrLf & vbCrLf
  1047.    
  1048.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1049.    Call cSetBitI(iData, 3, True)
  1050.    strDisplay = strDisplay + "   set bit 3 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1051.    Call cSetBitI(iData, 6, False)
  1052.    strDisplay = strDisplay + "   reset bit 6 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf
  1053.    Call cSetBitI(iData, 9, True)
  1054.    strDisplay = strDisplay + "   set bit 9 is " & iData & " (" & cToBinary(cMKI(iData)) & ")" & vbCrLf & vbCrLf
  1055.    
  1056.    strDisplay = strDisplay + "Long value : " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1057.    Call cSetBitL(lData, 6, True)
  1058.    strDisplay = strDisplay + "   set bit 6 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1059.    Call cSetBitL(lData, 12, False)
  1060.    strDisplay = strDisplay + "   reset bit 12 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf
  1061.    Call cSetBitL(lData, 24, True)
  1062.    strDisplay = strDisplay + "   set bit 24 is " & lData & " (" & cToBinary(cMKL(lData)) & ")" & vbCrLf & vbCrLf
  1063.    
  1064.    strDisplay = strDisplay + "Single value : " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1065.    Call cSetBitS(sData, 0, True)
  1066.    strDisplay = strDisplay + "   set bit 0 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1067.    Call cSetBitS(sData, 3, True)
  1068.    strDisplay = strDisplay + "   set bit 3 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1069.    Call cSetBitS(sData, 6, True)
  1070.    strDisplay = strDisplay + "   set bit 6 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1071.    Call cSetBitS(sData, 12, True)
  1072.    strDisplay = strDisplay + "   set bit 12 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf
  1073.    Call cSetBitS(sData, 24, True)
  1074.    strDisplay = strDisplay + "   set bit 24 is " & sData & " (" & cToBinary(cMKS(sData)) & ")" & vbCrLf & vbCrLf
  1075.    
  1076.    strDisplay = strDisplay + "Double value : " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1077.    Call cSetBitD(dData, 0, False)
  1078.    strDisplay = strDisplay + "   reset bit 0 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1079.    Call cSetBitD(dData, 3, False)
  1080.    strDisplay = strDisplay + "   reset bit 3 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1081.    Call cSetBitD(dData, 12, False)
  1082.    strDisplay = strDisplay + "   reset bit 12 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1083.    Call cSetBitD(dData, 24, False)
  1084.    strDisplay = strDisplay + "   reset bit 24 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf
  1085.    Call cSetBitD(dData, 48, False)
  1086.    strDisplay = strDisplay + "   reset bit 48 is " & dData & " (" & cToBinary(cMKD(dData)) & ")" & vbCrLf & vbCrLf
  1087.    
  1088.    txt_Result = strDisplay
  1089.  
  1090.    'time the function
  1091.  
  1092.    TimerHandle = cTimerOpen()
  1093.    TimerStartOk = cTimerStart(TimerHandle)
  1094.    
  1095.    For i = 1 To Iteration
  1096.       Call cSetBitI(iData, 0, True)
  1097.    Next i
  1098.    
  1099.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1100.    
  1101.    TimerCloseOk = cTimerClose(TimerHandle)
  1102.  
  1103. End Sub
  1104.  
  1105. Private Sub TestSetBit2Value()
  1106.    
  1107.    Dim intResult        As Integer
  1108.    Dim strResult        As String
  1109.    Dim strDisplay       As String
  1110.    
  1111.    Dim iData            As Integer
  1112.    Dim lData            As Long
  1113.    
  1114.    Dim i                As Integer
  1115.    
  1116.    intResult = 0
  1117.    
  1118.    strResult = ""
  1119.    strDisplay = ""
  1120.    
  1121.    iData = Abs(cRndI())
  1122.    lData = Abs(cRndL())
  1123.      
  1124.    strDisplay = strDisplay + "Integer value : " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1125.    Call cSetBitI2(iData, 3, True)
  1126.    strDisplay = strDisplay + "   set bit 3 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1127.    Call cSetBitI2(iData, 6, False)
  1128.    strDisplay = strDisplay + "   reset bit 6 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf
  1129.    Call cSetBitI2(iData, 9, True)
  1130.    strDisplay = strDisplay + "   set bit 9 is " & iData & " (" & cI2B(iData) & ")" & vbCrLf & vbCrLf
  1131.    
  1132.    strDisplay = strDisplay + "Long value : " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1133.    Call cSetBitL2(lData, 6, True)
  1134.    strDisplay = strDisplay + "   set bit 6 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1135.    Call cSetBitL2(lData, 12, False)
  1136.    strDisplay = strDisplay + "   reset bit 12 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf
  1137.    Call cSetBitL2(lData, 24, True)
  1138.    strDisplay = strDisplay + "   set bit 24 is " & lData & " (" & cL2B(lData) & ")" & vbCrLf & vbCrLf
  1139.    
  1140.    txt_Result = strDisplay
  1141.  
  1142.    'time the function
  1143.  
  1144.    TimerHandle = cTimerOpen()
  1145.    TimerStartOk = cTimerStart(TimerHandle)
  1146.    
  1147.    For i = 1 To Iteration
  1148.       Call cSetBitI2(iData, 0, True)
  1149.    Next i
  1150.    
  1151.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1152.    
  1153.    TimerCloseOk = cTimerClose(TimerHandle)
  1154.  
  1155. End Sub
  1156.  
  1157. Private Sub TestB2I()
  1158.    
  1159.    Dim lResult          As Long
  1160.    Dim strResult        As String
  1161.    Dim strDisplay       As String
  1162.    
  1163.    Dim i                As Integer
  1164.    
  1165.    Dim i1               As String
  1166.    Dim i2               As String
  1167.    Dim l1               As String
  1168.    Dim l2               As String
  1169.    
  1170.    i1 = "1010101010101010"
  1171.    i2 = "0101010101010101"
  1172.    
  1173.    l1 = "10101010101010101010101010101010"
  1174.    l2 = "01010101010101010101010101010101"
  1175.    
  1176.    lResult = 0
  1177.    
  1178.    strResult = ""
  1179.    strDisplay = ""
  1180.      
  1181.    strDisplay = strDisplay & "B2I of " & i1 & " is " & cB2I(i1) & vbCrLf
  1182.    strDisplay = strDisplay & "B2I of " & i2 & " is " & cB2I(i2) & vbCrLf & vbCrLf
  1183.    
  1184.    strDisplay = strDisplay & "I2B of " & cB2I(i1) & " is " & cI2B(cB2I(i1)) & vbCrLf
  1185.    strDisplay = strDisplay & "I2B of " & cB2I(i2) & " is " & cI2B(cB2I(i2)) & vbCrLf & vbCrLf
  1186.    
  1187.    strDisplay = strDisplay & "B2L of " & l1 & " is " & cB2L(l1) & vbCrLf
  1188.    strDisplay = strDisplay & "B2L of " & l2 & " is " & cB2L(l2) & vbCrLf & vbCrLf
  1189.    
  1190.    strDisplay = strDisplay & "L2B of " & cB2L(l1) & " is " & cL2B(cB2L(l1)) & vbCrLf
  1191.    strDisplay = strDisplay & "L2B of " & cB2L(l2) & " is " & cL2B(cB2L(l2)) & vbCrLf & vbCrLf
  1192.    
  1193.    txt_Result = strDisplay
  1194.  
  1195.    'time the function
  1196.  
  1197.    TimerHandle = cTimerOpen()
  1198.    TimerStartOk = cTimerStart(TimerHandle)
  1199.    
  1200.    For i = 1 To Iteration
  1201.       strResult = cB2I(12345)
  1202.    Next i
  1203.    
  1204.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1205.    
  1206.    TimerCloseOk = cTimerClose(TimerHandle)
  1207.  
  1208. End Sub
  1209.