home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / LVB / T2W32523.ZIP / _DATYPE.FRM < prev    next >
Text File  |  1998-04-07  |  13KB  |  376 lines

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