VB性能记录

来源:互联网 发布:冰点下载器 mac 编辑:程序博客网 时间:2024/06/11 01:17

此贴专门用来记录,我在VB中写的测试程序,与测试代码

VERSION 5.00Begin VB.Form Form1    Caption         =   "Form1"   ClientHeight    =   6945   ClientLeft      =   60   ClientTop       =   345   ClientWidth     =   9045   LinkTopic       =   "Form1"   ScaleHeight     =   6945   ScaleWidth      =   9045   StartUpPosition =   3  '窗口缺省   Begin VB.Timer Timer1       Interval        =   100      Left            =   3960      Top             =   3240   End   Begin VB.CommandButton Command1       Caption         =   "Command1"      Height          =   495      Left            =   1080      TabIndex        =   0      Top             =   3360      Width           =   1215   End   Begin VB.Shape Shape2       Height          =   735      Index           =   0      Left            =   8160      Top             =   720      Width           =   735   End   Begin VB.Shape Shape1       Height          =   735      Left            =   480      Top             =   720      Width           =   735   End   Begin VB.Line Line1       X1              =   240      X2              =   8880      Y1              =   1080      Y2              =   1080   EndEndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseDim strTmp1 As StringDim lngTime As LongDim strArray1() As StringDim i1 As Integer, ii2 As IntegerPrivate Sub Form_Load()'    strTmp1 = "a,a,a,a,b,b,a,b,b"    i1 = 0        strArray1 = Split(strTmp1, ",")        Call createShape    Debug.Print UBound(strArray1)    Debug.Print Me.Shape2.UBound    lngTime = 0End SubPrivate Sub Timer1_Timer()'    Dim l1 As Long'    Call test1'    Call shape_move1'    If i1 >= ii2 Then i1 = 1'    i1 = i1 + 1    Debug.Print i1            Call shape_move2(Me.Shape2(i1))    End SubSub test1()'    If i1 > 4 Then i1 = 0    i1 = i1 + 1    Me.Shape1.Shape = i1    Print i1    End SubPrivate Sub shape_move1()'    Me.Shape2(0).Left = Me.Shape2(0).Left - 100    End SubPrivate Sub shape_move2(shpTmp1 As Shape)'    shpTmp1.Left = shpTmp1.Left - 100        End SubPrivate Sub createShape()'    Dim i1 As Integer, i2 As Integer    Debug.Print UBound(strArray1)    i2 = 0    For i1 = 0 To UBound(strArray1)        Debug.Print strArray1(i1)        If strArray1(i1) = "a" Then            i2 = Me.Shape2.UBound + 1            Load Shape2(i2)'            Shape2(i2).Left = 0'            Shape2(i2).Top = 0            Shape2(i2).Shape = 2            Shape2(i2).Visible = True                     End If        If strArray1(i1) = "b" Then            i2 = Me.Shape2.UBound + 1            Load Shape2(i2)'            Shape2(i2).Left = 0'            Shape2(i2).Top = 0            Shape2(i2).Shape = 4            Shape2(i2).Visible = True        End If    Next i1        ii2 = Me.Shape2.UBound    Debug.Print ii2End Sub