home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / OPTIMIZE / CODE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-22  |  15.6 KB  |  500 lines

  1. VERSION 5.00
  2. Begin VB.Form Code 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "
  5.    ClientHeight    =   5220
  6.    ClientLeft      =   870
  7.    ClientTop       =   1515
  8.    ClientWidth     =   6975
  9.    ForeColor       =   &H80000008&
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    PaletteMode     =   1  'UseZOrder
  15.    ScaleHeight     =   5220
  16.    ScaleWidth      =   6975
  17.    ShowInTaskbar   =   0   'False
  18.    Tag             =   "Real"
  19.    WhatsThisHelp   =   -1  'True
  20.    Begin VB.TextBox txtLoopCount 
  21.       BeginProperty Font 
  22.          Name            =   "
  23.          Size            =   9
  24.          Charset         =   134
  25.          Weight          =   700
  26.          Underline       =   0   'False
  27.          Italic          =   0   'False
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       Height          =   320
  31.       Left            =   5600
  32.       TabIndex        =   8
  33.       Text            =   "txtLoopCount"
  34.       Top             =   3765
  35.       Width           =   1300
  36.    End
  37.    Begin VB.CommandButton cmdExplicit 
  38.       Caption         =   "
  39.       Height          =   450
  40.       Left            =   120
  41.       TabIndex        =   2
  42.       Top             =   2280
  43.       Width           =   1935
  44.    End
  45.    Begin VB.CommandButton cmdVariable 
  46.       Caption         =   "
  47.       Height          =   450
  48.       Left            =   120
  49.       TabIndex        =   1
  50.       Top             =   960
  51.       Width           =   1935
  52.    End
  53.    Begin VB.CommandButton cmdVariant 
  54.       Caption         =   "
  55.       Height          =   450
  56.       Left            =   120
  57.       TabIndex        =   4
  58.       Top             =   4190
  59.       Width           =   1935
  60.    End
  61.    Begin VB.CommandButton cmdInteger 
  62.       Caption         =   "
  63.       Height          =   450
  64.       Left            =   120
  65.       TabIndex        =   5
  66.       Top             =   4680
  67.       Width           =   1935
  68.    End
  69.    Begin VB.TextBox txtValue 
  70.       BeginProperty Font 
  71.          Name            =   "
  72.          Size            =   9
  73.          Charset         =   134
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   320
  80.       Left            =   5600
  81.       TabIndex        =   7
  82.       Text            =   "txtValue"
  83.       Top             =   1800
  84.       Width           =   1300
  85.    End
  86.    Begin VB.CommandButton cmdValue 
  87.       Caption         =   "
  88.       Height          =   450
  89.       Left            =   120
  90.       TabIndex        =   3
  91.       Top             =   2780
  92.       Width           =   1935
  93.    End
  94.    Begin VB.TextBox txtCounter 
  95.       BeginProperty Font 
  96.          Name            =   "
  97.          Size            =   9
  98.          Charset         =   134
  99.          Weight          =   700
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   320
  105.       Left            =   5600
  106.       TabIndex        =   6
  107.       Text            =   "txtCounter"
  108.       Top             =   60
  109.       Width           =   1300
  110.    End
  111.    Begin VB.CommandButton cmdProperty 
  112.       Caption         =   "
  113.       Default         =   -1  'True
  114.       Height          =   450
  115.       Left            =   120
  116.       TabIndex        =   0
  117.       Top             =   480
  118.       Width           =   1935
  119.    End
  120.    Begin VB.Line Line1 
  121.       BorderColor     =   &H00808080&
  122.       Index           =   3
  123.       X1              =   -15
  124.       X2              =   7320
  125.       Y1              =   3465
  126.       Y2              =   3465
  127.    End
  128.    Begin VB.Line Line1 
  129.       BorderColor     =   &H00FFFFFF&
  130.       BorderWidth     =   2
  131.       Index           =   2
  132.       X1              =   0
  133.       X2              =   7335
  134.       Y1              =   3480
  135.       Y2              =   3465
  136.    End
  137.    Begin VB.Line Line1 
  138.       BorderColor     =   &H00808080&
  139.       Index           =   1
  140.       X1              =   0
  141.       X2              =   7335
  142.       Y1              =   1680
  143.       Y2              =   1680
  144.    End
  145.    Begin VB.Label lblTitle 
  146.       Appearance      =   0  'Flat
  147.       AutoSize        =   -1  'True
  148.       BackColor       =   &H00FFFFFF&
  149.       BackStyle       =   0  'Transparent
  150.       Caption         =   "
  151.       BeginProperty Font 
  152.          Name            =   "
  153.          Size            =   12
  154.          Charset         =   134
  155.          Weight          =   700
  156.          Underline       =   0   'False
  157.          Italic          =   0   'False
  158.          Strikethrough   =   0   'False
  159.       EndProperty
  160.       ForeColor       =   &H00800000&
  161.       Height          =   240
  162.       Index           =   0
  163.       Left            =   120
  164.       TabIndex        =   21
  165.       Top             =   3750
  166.       Width           =   2055
  167.    End
  168.    Begin VB.Label lblTitle 
  169.       Appearance      =   0  'Flat
  170.       AutoSize        =   -1  'True
  171.       BackColor       =   &H00FFFFFF&
  172.       BackStyle       =   0  'Transparent
  173.       Caption         =   "
  174.       BeginProperty Font 
  175.          Name            =   "
  176.          Size            =   12
  177.          Charset         =   134
  178.          Weight          =   700
  179.          Underline       =   0   'False
  180.          Italic          =   0   'False
  181.          Strikethrough   =   0   'False
  182.       EndProperty
  183.       ForeColor       =   &H00800000&
  184.       Height          =   240
  185.       Index           =   2
  186.       Left            =   120
  187.       TabIndex        =   20
  188.       Top             =   1800
  189.       Width           =   2055
  190.    End
  191.    Begin VB.Label lblTitle 
  192.       Appearance      =   0  'Flat
  193.       AutoSize        =   -1  'True
  194.       BackColor       =   &H00FFFFFF&
  195.       BackStyle       =   0  'Transparent
  196.       Caption         =   "
  197.       BeginProperty Font 
  198.          Name            =   "
  199.          Size            =   12
  200.          Charset         =   134
  201.          Weight          =   700
  202.          Underline       =   0   'False
  203.          Italic          =   0   'False
  204.          Strikethrough   =   0   'False
  205.       EndProperty
  206.       ForeColor       =   &H00800000&
  207.       Height          =   240
  208.       Index           =   1
  209.       Left            =   120
  210.       TabIndex        =   19
  211.       Top             =   120
  212.       Width           =   1800
  213.    End
  214.    Begin VB.Label lblVariant 
  215.       Appearance      =   0  'Flat
  216.       BackColor       =   &H80000005&
  217.       BackStyle       =   0  'Transparent
  218.       Caption         =   "00.00 
  219.       BeginProperty Font 
  220.          Name            =   "
  221.          Size            =   9.75
  222.          Charset         =   134
  223.          Weight          =   700
  224.          Underline       =   0   'False
  225.          Italic          =   0   'False
  226.          Strikethrough   =   0   'False
  227.       EndProperty
  228.       ForeColor       =   &H80000008&
  229.       Height          =   250
  230.       Left            =   5600
  231.       TabIndex        =   18
  232.       Top             =   4290
  233.       Width           =   1800
  234.    End
  235.    Begin VB.Label lblInteger 
  236.       Appearance      =   0  'Flat
  237.       BackColor       =   &H80000005&
  238.       BackStyle       =   0  'Transparent
  239.       Caption         =   "00.00 
  240.       BeginProperty Font 
  241.          Name            =   "
  242.          Size            =   9.75
  243.          Charset         =   134
  244.          Weight          =   700
  245.          Underline       =   0   'False
  246.          Italic          =   0   'False
  247.          Strikethrough   =   0   'False
  248.       EndProperty
  249.       ForeColor       =   &H80000008&
  250.       Height          =   250
  251.       Left            =   5600
  252.       TabIndex        =   17
  253.       Top             =   4785
  254.       Width           =   1800
  255.    End
  256.    Begin VB.Label Label1 
  257.       Appearance      =   0  'Flat
  258.       BackColor       =   &H80000005&
  259.       BackStyle       =   0  'Transparent
  260.       Caption         =   "
  261.  Text 
  262.       ForeColor       =   &H80000008&
  263.       Height          =   250
  264.       Index           =   3
  265.       Left            =   2145
  266.       TabIndex        =   16
  267.       Top             =   2385
  268.       Width           =   2700
  269.    End
  270.    Begin VB.Label lblExplicit 
  271.       Appearance      =   0  'Flat
  272.       BackColor       =   &H80000005&
  273.       BackStyle       =   0  'Transparent
  274.       Caption         =   "00.00 
  275.       BeginProperty Font 
  276.          Name            =   "
  277.          Size            =   9.75
  278.          Charset         =   134
  279.          Weight          =   700
  280.          Underline       =   0   'False
  281.          Italic          =   0   'False
  282.          Strikethrough   =   0   'False
  283.       EndProperty
  284.       ForeColor       =   &H80000008&
  285.       Height          =   250
  286.       Left            =   5600
  287.       TabIndex        =   15
  288.       Top             =   2385
  289.       Width           =   1300
  290.    End
  291.    Begin VB.Label Label1 
  292.       Appearance      =   0  'Flat
  293.       BackColor       =   &H80000005&
  294.       BackStyle       =   0  'Transparent
  295.       Caption         =   "
  296.       ForeColor       =   &H80000008&
  297.       Height          =   250
  298.       Index           =   2
  299.       Left            =   2145
  300.       TabIndex        =   14
  301.       Top             =   2880
  302.       Width           =   2700
  303.    End
  304.    Begin VB.Label lblValue 
  305.       Appearance      =   0  'Flat
  306.       BackColor       =   &H80000005&
  307.       BackStyle       =   0  'Transparent
  308.       Caption         =   "00.00 
  309.       BeginProperty Font 
  310.          Name            =   "
  311.          Size            =   9.75
  312.          Charset         =   134
  313.          Weight          =   700
  314.          Underline       =   0   'False
  315.          Italic          =   0   'False
  316.          Strikethrough   =   0   'False
  317.       EndProperty
  318.       ForeColor       =   &H80000008&
  319.       Height          =   250
  320.       Left            =   5600
  321.       TabIndex        =   13
  322.       Top             =   2880
  323.       Width           =   1300
  324.    End
  325.    Begin VB.Line Line1 
  326.       BorderColor     =   &H00FFFFFF&
  327.       BorderWidth     =   2
  328.       Index           =   0
  329.       X1              =   15
  330.       X2              =   7350
  331.       Y1              =   1695
  332.       Y2              =   1680
  333.    End
  334.    Begin VB.Label lblVariable 
  335.       Appearance      =   0  'Flat
  336.       BackColor       =   &H80000005&
  337.       BackStyle       =   0  'Transparent
  338.       Caption         =   "00.00 
  339.       BeginProperty Font 
  340.          Name            =   "
  341.          Size            =   9.75
  342.          Charset         =   134
  343.          Weight          =   700
  344.          Underline       =   0   'False
  345.          Italic          =   0   'False
  346.          Strikethrough   =   0   'False
  347.       EndProperty
  348.       ForeColor       =   &H80000008&
  349.       Height          =   250
  350.       Left            =   5600
  351.       TabIndex        =   12
  352.       Top             =   1080
  353.       Width           =   1300
  354.    End
  355.    Begin VB.Label Label1 
  356.       Appearance      =   0  'Flat
  357.       BackColor       =   &H80000005&
  358.       BackStyle       =   0  'Transparent
  359.       Caption         =   "
  360.       ForeColor       =   &H80000008&
  361.       Height          =   250
  362.       Index           =   1
  363.       Left            =   2145
  364.       TabIndex        =   11
  365.       Top             =   1080
  366.       Width           =   3100
  367.    End
  368.    Begin VB.Label lblProperty 
  369.       Appearance      =   0  'Flat
  370.       BackColor       =   &H80000005&
  371.       BackStyle       =   0  'Transparent
  372.       Caption         =   "00.00 
  373.       BeginProperty Font 
  374.          Name            =   "
  375.          Size            =   9.75
  376.          Charset         =   134
  377.          Weight          =   700
  378.          Underline       =   0   'False
  379.          Italic          =   0   'False
  380.          Strikethrough   =   0   'False
  381.       EndProperty
  382.       ForeColor       =   &H80000008&
  383.       Height          =   250
  384.       Left            =   5600
  385.       TabIndex        =   10
  386.       Top             =   585
  387.       Width           =   1300
  388.    End
  389.    Begin VB.Label Label1 
  390.       Appearance      =   0  'Flat
  391.       BackColor       =   &H80000005&
  392.       BackStyle       =   0  'Transparent
  393.       Caption         =   "
  394.  Text 
  395.       ForeColor       =   &H80000008&
  396.       Height          =   250
  397.       Index           =   0
  398.       Left            =   2145
  399.       TabIndex        =   9
  400.       Top             =   585
  401.       Width           =   3105
  402.    End
  403. Attribute VB_Name = "Code"
  404. Attribute VB_GlobalNameSpace = False
  405. Attribute VB_Creatable = False
  406. Attribute VB_PredeclaredId = True
  407. Attribute VB_Exposed = False
  408. Private Sub cmdExplicit_Click()
  409.  (txtValue.Text) 
  410. 'Sub cmdValue_Click 
  411.     Limit% = Val(txtValue)
  412.     Screen.MousePointer = 11
  413.     start = Timer
  414.     For x% = 1 To Limit%
  415.         foo$ = txtValue.Text
  416.     Next x%
  417.     Finish = Timer
  418.     Screen.MousePointer = 0
  419.     lblExplicit = Format$(Finish - start, "##.##") & " 
  420. End Sub
  421. Private Sub cmdInteger_Click()
  422.  Sub cmdVariant_Click 
  423. Dim intCounter1 As Integer, intCounter2 As Integer, intCounter3 As Integer
  424.     Screen.MousePointer = 11
  425.     start = Timer
  426.     For intCounter1 = 1 To 100
  427.         For intCounter2 = 1 To intCounter1
  428.             For intCounter3 = 1 To intCounter2
  429.                 Var = intCounter3 * 100 + intCounter2 * 10 + intCounter1
  430.             Next intCounter3
  431.         Next intCounter2
  432.     Next intCounter1
  433.     Finish = Timer
  434.     Screen.MousePointer = 0
  435.     lblInteger = Format$(Finish - start, "##.##") & " 
  436. End Sub
  437. Private Sub cmdProperty_Click()
  438.  Text 
  439. 'Sub cmdVariable_Click 
  440.     Limit% = Val(txtCounter.Text)
  441.     Screen.MousePointer = 11
  442.     start = Timer
  443.     For x% = 1 To Limit%
  444.         foo$ = Left(txtCounter.Text, Len(txtCounter.Text) \ 2)
  445.     Next x%
  446.     Finish = Timer
  447.     Screen.MousePointer = 0
  448.     lblProperty = Format$(Finish - start, "##.##") & " 
  449. End Sub
  450. Private Sub cmdValue_Click()
  451.  Text 
  452.  Sub cmdExplicit_Click 
  453.     Limit% = Val(txtValue)
  454.     Screen.MousePointer = 11
  455.     start = Timer
  456.     For x% = 1 To Limit%
  457.         foo$ = txtValue
  458.     Next x%
  459.     Finish = Timer
  460.     Screen.MousePointer = 0
  461.     lblValue = Format$(Finish - start, "##.##") & " 
  462. End Sub
  463. Private Sub cmdVariable_Click()
  464.  (Temp$) 
  465.  Sub cmdProperty_Click 
  466.     Limit% = Val(txtCounter.Text)
  467.     Temp$ = txtCounter.Text
  468.     Screen.MousePointer = 11
  469.     start = Timer
  470.     For x% = 1 To Limit%
  471.         foo$ = Left(Temp$, Len(Temp$) \ 2)
  472.     Next x%
  473.     Finish = Timer
  474.     Screen.MousePointer = 0
  475.     lblVariable = Format$(Finish - start, "##.##") & " 
  476. End Sub
  477. Private Sub cmdVariant_Click()
  478.  Sub cmdInteger_Click 
  479.  Sub cmdInteger_Click 
  480.     Screen.MousePointer = 11
  481.     start = Timer
  482.     For varCounter1 = 1 To txtLoopCount.Text
  483.         For varCounter2 = 1 To varCounter1
  484.             For varCounter3 = 1 To varCounter2
  485.                 Var = varCounter3 * 100 + varCounter2 * 10 + varCounter1
  486.             Next varCounter3
  487.         Next varCounter2
  488.     Next varCounter1
  489.     Finish = Timer
  490.     Screen.MousePointer = 0
  491.     lblVariant = Format$(Finish - start, "##.##") & " 
  492. End Sub
  493. Private Sub Form_Load()
  494.     PosForm Me
  495.     ' 
  496.     txtCounter = 1000
  497.     txtValue = 1000
  498.     txtLoopCount = 100
  499. End Sub
  500.