home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 3465
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6600
- LinkTopic = "Form1"
- ScaleHeight = 3465
- ScaleWidth = 6600
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command2
- Caption = "VB-code"
- Height = 495
- Left = 480
- TabIndex = 1
- Top = 840
- Width = 1215
- End
- Begin VB.CommandButton Command1
- Caption = "C++-server"
- Height = 495
- Left = 480
- TabIndex = 0
- Top = 1440
- Width = 1215
- End
- Begin VB.Label txtTemp
- Caption = "Label1"
- Height = 495
- Left = 1920
- TabIndex = 5
- Top = 2640
- Width = 1215
- End
- Begin VB.Label txtTid
- Caption = "Label1"
- Height = 495
- Left = 1920
- TabIndex = 4
- Top = 2160
- Width = 1215
- End
- Begin VB.Label txtTidC
- Caption = "Time:"
- Height = 255
- Left = 480
- TabIndex = 3
- Top = 2160
- Width = 1215
- End
- Begin VB.Label Label3
- Caption = "Rebase an array with 20*1000 fields from base 0 to 1 ( ADO Recordset for instance )"
- Height = 495
- Left = 120
- TabIndex = 2
- Top = 120
- Width = 6255
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Option Base 1
- Private Sub Command2_Click()
- Dim sStart As Single
- Dim sStop As Single
- Dim vData As Variant
- vData = GetData
- If LBound(vData, 1) <> 0 Then
- MsgBox "FEL"
- End If
- If LBound(vData, 2) <> 0 Then
- MsgBox "FEL"
- End If
- sStart = Timer
- vData = Rebase(vData)
- sStop = Timer
- txtTid.Caption = CStr(sStop - sStart)
- txtTemp.Caption = "Nr of rows:" & UBound(vData, 1) & " Columns:" & UBound(vData, 2)
- If LBound(vData, 1) <> 1 Then
- MsgBox "FEL"
- End If
- If LBound(vData, 2) <> 1 Then
- MsgBox "FEL"
- End If
- End Sub
- Private Sub Command1_Click()
- Dim sStart As Single
- Dim sStop As Single
- Dim vData As Variant
- Dim oChanger As ARRAYHAND_SRVLib.ArrayHandler
- vData = GetData
- If LBound(vData, 1) <> 0 Then
- MsgBox "FEL"
- End If
- If LBound(vData, 2) <> 0 Then
- MsgBox "FEL"
- End If
- sStart = Timer
- Set oChanger = New ARRAYHAND_SRVLib.ArrayHandler
- oChanger.BaseZeroToOne vData
- sStop = Timer
- txtTid.Caption = CStr(sStop - sStart)
- txtTemp.Caption = "Nr of rows:" & UBound(vData, 1) & " Columns:" & UBound(vData, 2)
- If LBound(vData, 1) <> 1 Then
- MsgBox "FEL"
- End If
- If LBound(vData, 2) <> 1 Then
- MsgBox "FEL"
- End If
- End Sub
- Function GetData() As Variant
- Dim nRow As Integer
- Dim nCol As Integer
- Dim vData(0 To 19, 0 To 999) As Variant
- For nRow = 0 To 19
- For nCol = 0 To 999
- vData(nRow, nCol) = CStr(nRow) & ";" & CStr(nCol)
- Next
- GetData = vData
- End Function
- Public Function Rebase(vArray As Variant) As Variant
- Dim vRetArray() As Variant
- Dim nRow As Integer
- Dim nCol As Integer
- Dim nRows As Integer
- Dim nCols As Integer
- nRows = UBound(vArray, 1)
- nCols = UBound(vArray, 2)
- ReDim vRetArray(1 To nRows + 1, 1 To nCols + 1)
- For nRow = 0 To nRows
- For nCol = 0 To nCols
- vRetArray(nRow + 1, nCol + 1) = vArray(nRow, nCol)
- Next
- Rebase = vRetArray
- End Function
-