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

  1. VERSION 5.00
  2. Begin VB.Form Strings 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "
  5.    ClientHeight    =   4650
  6.    ClientLeft      =   1575
  7.    ClientTop       =   2100
  8.    ClientWidth     =   7215
  9.    ForeColor       =   &H80000008&
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   4650
  15.    ScaleWidth      =   7215
  16.    ShowInTaskbar   =   0   'False
  17.    Tag             =   "Real"
  18.    Begin VB.CommandButton cmdString 
  19.       Caption         =   "
  20.       Height          =   450
  21.       Index           =   1
  22.       Left            =   120
  23.       TabIndex        =   1
  24.       Top             =   1320
  25.       Width           =   1900
  26.    End
  27.    Begin VB.TextBox txtCount2 
  28.       BeginProperty Font 
  29.          Name            =   "
  30.          Size            =   9
  31.          Charset         =   0
  32.          Weight          =   700
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   280
  38.       Left            =   5700
  39.       TabIndex        =   5
  40.       Text            =   "1000"
  41.       Top             =   2520
  42.       Width           =   1400
  43.    End
  44.    Begin VB.CommandButton cmdFiles 
  45.       Caption         =   "
  46.       Height          =   450
  47.       Index           =   1
  48.       Left            =   120
  49.       TabIndex        =   3
  50.       Top             =   3840
  51.       Width           =   1900
  52.    End
  53.    Begin VB.CommandButton cmdFiles 
  54.       Caption         =   "
  55.       Height          =   450
  56.       Index           =   0
  57.       Left            =   120
  58.       TabIndex        =   2
  59.       Top             =   3120
  60.       Width           =   1900
  61.    End
  62.    Begin VB.CommandButton cmdString 
  63.       Caption         =   "
  64.       Default         =   -1  'True
  65.       Height          =   450
  66.       Index           =   0
  67.       Left            =   120
  68.       TabIndex        =   0
  69.       Top             =   660
  70.       Width           =   1900
  71.    End
  72.    Begin VB.TextBox txtCounter 
  73.       BeginProperty Font 
  74.          Name            =   "
  75.          Size            =   9
  76.          Charset         =   0
  77.          Weight          =   700
  78.          Underline       =   0   'False
  79.          Italic          =   0   'False
  80.          Strikethrough   =   0   'False
  81.       EndProperty
  82.       Height          =   280
  83.       Left            =   5700
  84.       TabIndex        =   4
  85.       Text            =   "txtCounter"
  86.       Top             =   120
  87.       Width           =   1400
  88.    End
  89.    Begin VB.Label lblFiles 
  90.       Appearance      =   0  'Flat
  91.       BackColor       =   &H80000005&
  92.       BackStyle       =   0  'Transparent
  93.       Caption         =   "00.00 
  94.       BeginProperty Font 
  95.          Name            =   "
  96.          Size            =   9.75
  97.          Charset         =   134
  98.          Weight          =   700
  99.          Underline       =   0   'False
  100.          Italic          =   0   'False
  101.          Strikethrough   =   0   'False
  102.       EndProperty
  103.       ForeColor       =   &H00800000&
  104.       Height          =   280
  105.       Index           =   1
  106.       Left            =   5700
  107.       TabIndex        =   8
  108.       Top             =   3840
  109.       Width           =   1400
  110.    End
  111.    Begin VB.Label lblFiles 
  112.       Appearance      =   0  'Flat
  113.       BackColor       =   &H80000005&
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "00.00 
  116.       BeginProperty Font 
  117.          Name            =   "
  118.          Size            =   9.75
  119.          Charset         =   134
  120.          Weight          =   700
  121.          Underline       =   0   'False
  122.          Italic          =   0   'False
  123.          Strikethrough   =   0   'False
  124.       EndProperty
  125.       ForeColor       =   &H00800000&
  126.       Height          =   280
  127.       Index           =   0
  128.       Left            =   5700
  129.       TabIndex        =   10
  130.       Top             =   3120
  131.       Width           =   1400
  132.    End
  133.    Begin VB.Label Label2 
  134.       Appearance      =   0  'Flat
  135.       BackColor       =   &H80000005&
  136.       BackStyle       =   0  'Transparent
  137.       Caption         =   "
  138.       ForeColor       =   &H80000008&
  139.       Height          =   450
  140.       Left            =   2150
  141.       TabIndex        =   13
  142.       Top             =   3840
  143.       Width           =   3100
  144.    End
  145.    Begin VB.Label Label1 
  146.       Appearance      =   0  'Flat
  147.       BackColor       =   &H80000005&
  148.       BackStyle       =   0  'Transparent
  149.       Caption         =   "
  150.       ForeColor       =   &H80000008&
  151.       Height          =   450
  152.       Index           =   4
  153.       Left            =   2150
  154.       TabIndex        =   15
  155.       Top             =   3120
  156.       Width           =   3100
  157.    End
  158.    Begin VB.Label lblTitle 
  159.       Appearance      =   0  'Flat
  160.       AutoSize        =   -1  'True
  161.       BackColor       =   &H80000005&
  162.       BackStyle       =   0  'Transparent
  163.       Caption         =   "
  164.       BeginProperty Font 
  165.          Name            =   "
  166.          Size            =   12
  167.          Charset         =   134
  168.          Weight          =   700
  169.          Underline       =   0   'False
  170.          Italic          =   0   'False
  171.          Strikethrough   =   0   'False
  172.       EndProperty
  173.       ForeColor       =   &H00800000&
  174.       Height          =   240
  175.       Index           =   2
  176.       Left            =   120
  177.       TabIndex        =   14
  178.       Top             =   2400
  179.       Width           =   1680
  180.    End
  181.    Begin VB.Line Line2 
  182.       BorderColor     =   &H00808080&
  183.       X1              =   0
  184.       X2              =   7335
  185.       Y1              =   2100
  186.       Y2              =   2100
  187.    End
  188.    Begin VB.Label Label1 
  189.       Appearance      =   0  'Flat
  190.       BackColor       =   &H80000005&
  191.       BackStyle       =   0  'Transparent
  192.       Caption         =   "
  193.       ForeColor       =   &H80000008&
  194.       Height          =   435
  195.       Index           =   3
  196.       Left            =   2145
  197.       TabIndex        =   12
  198.       Top             =   1320
  199.       Width           =   3105
  200.    End
  201.    Begin VB.Label Label1 
  202.       Appearance      =   0  'Flat
  203.       BackColor       =   &H80000005&
  204.       BackStyle       =   0  'Transparent
  205.       Caption         =   "
  206.       ForeColor       =   &H80000008&
  207.       Height          =   450
  208.       Index           =   2
  209.       Left            =   2150
  210.       TabIndex        =   11
  211.       Top             =   660
  212.       Width           =   3100
  213.    End
  214.    Begin VB.Label lblString 
  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       =   &H00800000&
  229.       Height          =   280
  230.       Index           =   0
  231.       Left            =   5700
  232.       TabIndex        =   9
  233.       Top             =   660
  234.       Width           =   1400
  235.    End
  236.    Begin VB.Label lblString 
  237.       Appearance      =   0  'Flat
  238.       BackColor       =   &H80000005&
  239.       BackStyle       =   0  'Transparent
  240.       Caption         =   "00.00 
  241.       BeginProperty Font 
  242.          Name            =   "
  243.          Size            =   9.75
  244.          Charset         =   134
  245.          Weight          =   700
  246.          Underline       =   0   'False
  247.          Italic          =   0   'False
  248.          Strikethrough   =   0   'False
  249.       EndProperty
  250.       ForeColor       =   &H00800000&
  251.       Height          =   280
  252.       Index           =   1
  253.       Left            =   5700
  254.       TabIndex        =   7
  255.       Top             =   1320
  256.       Width           =   1400
  257.    End
  258.    Begin VB.Label lblTitle 
  259.       Appearance      =   0  'Flat
  260.       AutoSize        =   -1  'True
  261.       BackColor       =   &H80000005&
  262.       BackStyle       =   0  'Transparent
  263.       Caption         =   "
  264.       BeginProperty Font 
  265.          Name            =   "
  266.          Size            =   12
  267.          Charset         =   134
  268.          Weight          =   700
  269.          Underline       =   0   'False
  270.          Italic          =   0   'False
  271.          Strikethrough   =   0   'False
  272.       EndProperty
  273.       ForeColor       =   &H00800000&
  274.       Height          =   240
  275.       Index           =   1
  276.       Left            =   120
  277.       TabIndex        =   6
  278.       Top             =   60
  279.       Width           =   780
  280.    End
  281.    Begin VB.Line Line1 
  282.       BorderColor     =   &H00FFFFFF&
  283.       BorderWidth     =   2
  284.       Index           =   0
  285.       X1              =   0
  286.       X2              =   7335
  287.       Y1              =   2115
  288.       Y2              =   2115
  289.    End
  290. Attribute VB_Name = "Strings"
  291. Attribute VB_GlobalNameSpace = False
  292. Attribute VB_Creatable = False
  293. Attribute VB_PredeclaredId = True
  294. Attribute VB_Exposed = False
  295. Private Sub cmdFiles_Click(Index As Integer)
  296.     On Error Resume Next
  297.     Dim allrecs() As BookAuthor
  298.     ReDim allrecs(txtCount2)
  299.     Me.MousePointer = 11
  300.     For x = 1 To txtCount2
  301.         allrecs(x).ID = x
  302.         allrecs(x).Name = "
  303.     Next x
  304.     Kill App.Path & "\" & "files.out"
  305.     If Index = 0 Then
  306.         Open App.Path & "\" & "files.out" For Random As #1
  307.     Else
  308.         Open App.Path & "\" & "files.out" For Binary As #1
  309.     End If
  310.     start# = Timer
  311.     For x = 1 To txtCount2
  312.        Put #1, , allrecs(x)
  313.     Next x
  314.     Seek #1, 1
  315.     For x = 1 To txtCount2
  316.         Get #1, , allrecs(x)
  317.     Next x
  318.     Finish# = Timer
  319.     lblFiles(Index) = Format(Finish# - start#, "##.##") & " 
  320.     Close #1
  321.     Me.MousePointer = 0
  322. End Sub
  323. Private Sub cmdString_Click(Index As Integer)
  324.     strfirst$ = "
  325.     strsecond$ = "
  326.     strthird$ = "
  327.     MousePointer = 11
  328.     If Index = 0 Then
  329.         start# = Timer
  330.         For x = 1 To txtCounter
  331.             result$ = strfirst$ & strsecond$ & strthird$
  332.         Next x
  333.         Finish# = Timer
  334.     Else
  335.         Temp$ = strfirst$ & strsecond$ & strthird$
  336.         start# = Timer
  337.         For x = 1 To txtCounter
  338.             result$ = Temp$
  339.         Next x
  340.         Finish# = Timer
  341.     End If
  342.     lblString(Index) = Format$(Finish# - start#, "##.##") & " 
  343.     MousePointer = 0
  344. End Sub
  345. Private Sub Form_Load()
  346.   PosForm Me
  347.   txtCounter = 10000
  348.   txtCount2 = 1000
  349. End Sub
  350.