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

  1. VERSION 5.00
  2. Begin VB.Form frmDAType 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Disk array : type"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   9285
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4065
  13.    ScaleWidth      =   9285
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   2
  19.       Top             =   -90
  20.       Width           =   9285
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   8910
  26.          TabIndex        =   7
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   8010
  35.          TabIndex        =   6
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   8370
  44.          TabIndex        =   5
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   3
  52.          Top             =   180
  53.          Width           =   6555
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   4
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.Label lbl_Result 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       BackStyle       =   0  'Transparent
  68.       ForeColor       =   &H80000008&
  69.       Height          =   3345
  70.       Left            =   2940
  71.       TabIndex        =   1
  72.       Top             =   630
  73.       Width           =   6315
  74.    End
  75.    Begin VB.Label lbl_Open 
  76.       Appearance      =   0  'Flat
  77.       BackColor       =   &H80000005&
  78.       BackStyle       =   0  'Transparent
  79.       BeginProperty Font 
  80.          Name            =   "Courier New"
  81.          Size            =   8.25
  82.          Charset         =   0
  83.          Weight          =   400
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.       ForeColor       =   &H80000008&
  89.       Height          =   3345
  90.       Left            =   90
  91.       TabIndex        =   0
  92.       Top             =   630
  93.       Width           =   2715
  94.    End
  95. End
  96. Attribute VB_Name = "frmDAType"
  97. Attribute VB_GlobalNameSpace = False
  98. Attribute VB_Creatable = False
  99. Attribute VB_PredeclaredId = True
  100. Attribute VB_Exposed = False
  101. Option Explicit
  102. Option Base 1
  103.  
  104. Private Const Iteration = 50
  105.  
  106. Dim IsLoaded         As Integer
  107.  
  108. Dim TimerStartOk     As Integer
  109. Dim TimerCloseOk     As Integer
  110.  
  111. Dim TimerHandle      As Integer
  112. Dim TimerValue       As Long
  113.  
  114.       
  115.  
  116. Private Sub cmdNP_Click(Index As Integer)
  117.  
  118.    Call sub_NextPrev(cmb_Function, Index)
  119.  
  120. End Sub
  121.  
  122.  
  123. Private Sub cmb_Function_Click()
  124.    
  125.    If (IsLoaded = False) Then Exit Sub
  126.    
  127.    Call cDisableFI(mdiT2W.Picture1)
  128.    
  129.    lbl_Result = ""
  130.    
  131.    DoEvents
  132.    
  133.    Call TestDAType(cmb_Function.ListIndex - 1)
  134.  
  135.    DoEvents
  136.    Call cEnableFI(mdiT2W.Picture1)
  137.    
  138. End Sub
  139.  
  140.  
  141. Private Sub Form_Activate()
  142.  
  143.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  144.  
  145. End Sub
  146.  
  147. Private Sub Form_Load()
  148.  
  149.    IsLoaded = False
  150.    
  151.    Show
  152.  
  153.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_datype.t2w")
  154.    
  155.    IsLoaded = True
  156.    
  157. End Sub
  158.  
  159. Private Sub Form_Unload(Cancel As Integer)
  160.  
  161.    Dim intResult        As Integer
  162.  
  163.    intResult = cKillFileAll("c:\t2w_tmp\datype.tmp")
  164.  
  165. End Sub
  166.  
  167.  
  168. Private Sub Command1_Click()
  169.    
  170.    Call cmb_Function_Click
  171.    
  172. End Sub
  173.  
  174.  
  175.  
  176.  
  177. Private Sub TestDAType(intManagement As Integer)
  178.    
  179.    Dim intResult        As Integer
  180.    Dim strResult        As String
  181.    Dim strOpen          As String
  182.    Dim strDisplay       As String
  183.    
  184.    Dim i                As Integer
  185.    Dim DA               As tagDISKARRAY
  186.    Dim SRD              As tagSERIALDATA
  187.    
  188.    intResult = 0
  189.    
  190.    strResult = ""
  191.    strOpen = ""
  192.    strDisplay = ""
  193.       
  194.    DA.nFileName = T2WDirTest + "\datype.tmp"
  195.    DA.nType = Len(SRD)
  196.    DA.nIsTyped = True
  197.    DA.nRows = 10
  198.    DA.nCols = 10
  199.    DA.nSheets = 2
  200.  
  201.    Select Case intManagement
  202.       Case True      'create
  203.          intResult = cDACreate(DA, True)
  204.       Case False     'use
  205.          intResult = cDACreate(DA, False)
  206.       Case 1         'clear all
  207.          intResult = cDACreate(DA, False)
  208.          If (intResult = -1) Then intResult = cDAClear(DA)
  209.       Case 2         'clear sheet 2
  210.          intResult = cDACreate(DA, False)
  211.          If (intResult = -1) Then intResult = cDAClearSheet(DA, 2)
  212.       Case 3         'clear last row
  213.          intResult = cDACreate(DA, False)
  214.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, 1)
  215.       Case 4         'clear last col
  216.          intResult = cDACreate(DA, False)
  217.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, 1)
  218.       Case 5         'clear last row in all sheets
  219.          intResult = cDACreate(DA, False)
  220.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, -1)
  221.       Case 6         'clear last col in all sheets
  222.          intResult = cDACreate(DA, False)
  223.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, -1)
  224.    End Select
  225.  
  226.    strDisplay = strDisplay & "Last intResult = " & intResult & vbCrLf & vbCrLf
  227.  
  228.    If (intResult = True) Then
  229.       
  230.       strOpen = strOpen & "daSize       = " & DA.daSize & vbCrLf
  231.       strOpen = strOpen & "Signature    = " & DA.signature & vbCrLf
  232.       strOpen = strOpen & "nFilename    = " & Trim$(cGetInPartR(DA.nFileName, "\", True)) & vbCrLf
  233.       strOpen = strOpen & "nType        = " & DA.nType & vbCrLf
  234.       strOpen = strOpen & "nIsTyped     = " & DA.nIsTyped & vbCrLf
  235.       strOpen = strOpen & "nRows        = " & DA.nRows & vbCrLf
  236.       strOpen = strOpen & "nCols        = " & DA.nCols & vbCrLf
  237.       strOpen = strOpen & "nSheets      = " & DA.nSheets & vbCrLf
  238.       strOpen = strOpen & "rHandle      = " & DA.rHandle & vbCrLf
  239.       strOpen = strOpen & "rElementSize = " & DA.rElementSize & vbCrLf
  240.       strOpen = strOpen & "rFileSize    = " & DA.rFileSize & vbCrLf
  241.       strOpen = strOpen & "rParts       = " & DA.rParts & vbCrLf
  242.       strOpen = strOpen & "rRemain      = " & DA.rRemain & vbCrLf
  243.       strOpen = strOpen & "rSheetSize   = " & DA.rSheetSize & vbCrLf
  244.       strOpen = strOpen & "rTime        = " & DA.rTime & vbCrLf & vbCrLf
  245.  
  246.       If (intManagement = True) Then
  247.       
  248.          SRD.Description1 = "DA type test 1 1 1"
  249.          Call cDAPutType(DA, 1, 1, 1, SRD)
  250.          SRD.Description1 = "DA type test 1 1 " & DA.nCols
  251.          Call cDAPutType(DA, 1, DA.nCols, 1, SRD)
  252.          SRD.Description1 = "DA type test 1 " & DA.nRows & " " & 1
  253.          Call cDAPutType(DA, DA.nRows, 1, 1, SRD)
  254.          SRD.Description1 = "DA type test 1 " & DA.nRows & " " & DA.nCols
  255.          Call cDAPutType(DA, DA.nRows, DA.nCols, 1, SRD)
  256.    
  257.          SRD.Description1 = "DA type test 2 1 1"
  258.          Call cDAPutType(DA, 1, 1, 2, SRD)
  259.          SRD.Description1 = "DA type test 2 1 " & DA.nCols
  260.          Call cDAPutType(DA, 1, DA.nCols, 2, SRD)
  261.          SRD.Description1 = "DA type test 2 " & DA.nRows & " " & 1
  262.          Call cDAPutType(DA, DA.nRows, 1, 2, SRD)
  263.          SRD.Description1 = "DA type test 2 " & DA.nRows & " " & DA.nCols
  264.          Call cDAPutType(DA, DA.nRows, DA.nCols, 2, SRD)
  265.  
  266.       End If
  267.    
  268.       Call cDAGetType(DA, 1, 1, 1, SRD)
  269.       strDisplay = strDisplay & "R:1  , C:1  , D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  270.       Call cDAGetType(DA, 1, DA.nCols, 1, SRD)
  271.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  272.       Call cDAGetType(DA, DA.nRows, 1, 1, SRD)
  273.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  274.       Call cDAGetType(DA, DA.nRows, DA.nCols, 1, SRD)
  275.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  276.    
  277.       Call cDAGetType(DA, 1, 1, 2, SRD)
  278.       strDisplay = strDisplay & "R:1  , C:1  , D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  279.       Call cDAGetType(DA, 1, DA.nCols, 2, SRD)
  280.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  281.       Call cDAGetType(DA, DA.nRows, 1, 2, SRD)
  282.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  283.       Call cDAGetType(DA, DA.nRows, DA.nCols, 2, SRD)
  284.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  285.  
  286.    End If
  287.  
  288.    Call cDAClose(DA, False)
  289.  
  290.    lbl_Open = strOpen
  291.    lbl_Result = strDisplay
  292.  
  293.    'time the function
  294.  
  295.    TimerHandle = cTimerOpen()
  296.    TimerStartOk = cTimerStart(TimerHandle)
  297.    
  298.    For i = 1 To Iteration
  299.       strResult = cDACreate(DA, False)
  300.       Call cDAClose(DA, False)
  301.    Next i
  302.    
  303.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  304.    
  305.    TimerCloseOk = cTimerClose(TimerHandle)
  306.  
  307. End Sub
  308.  
  309.