VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4140
   ClientLeft      =   11370
   ClientTop       =   4710
   ClientWidth     =   6615
   LinkTopic       =   "Form1"
   ScaleHeight     =   4140
   ScaleWidth      =   6615
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   4
      Left            =   3120
      MultiLine       =   -1  'True
      TabIndex        =   5
      Text            =   "Form1.frx":0000
      Top             =   3120
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   1095
      Index           =   3
      Left            =   3120
      MultiLine       =   -1  'True
      TabIndex        =   4
      Text            =   "Form1.frx":0006
      Top             =   1920
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   2
      Left            =   3120
      MultiLine       =   -1  'True
      TabIndex        =   3
      Text            =   "Form1.frx":000C
      Top             =   1440
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   1
      Left            =   3120
      MultiLine       =   -1  'True
      TabIndex        =   2
      Text            =   "Form1.frx":0012
      Top             =   960
      Width           =   2535
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Index           =   0
      Left            =   3120
      MultiLine       =   -1  'True
      TabIndex        =   1
      Text            =   "Form1.frx":0018
      Top             =   480
      Width           =   2535
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   2520
      Width           =   2655
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()

Dim onemegabyte As Long

onemegabyte = 1024& * 1024&
tenmegabyte = onemegabyte * 10

ReDim b!(tenmegabyte)   '40 megabytes
ReDim c&(tenmegabyte)   '40 megabytes
ReDim d#(tenmegabyte)   '80 megabytes

ReDim b1!(tenmegabyte)
ReDim c1&(tenmegabyte)
ReDim d1#(tenmegabyte)

ReDim b2!(tenmegabyte)
ReDim c2&(tenmegabyte)
ReDim d2#(tenmegabyte)

ReDim b3!(tenmegabyte)
ReDim c3&(tenmegabyte)
ReDim d3#(tenmegabyte)

ReDim b4!(tenmegabyte)
ReDim c4&(tenmegabyte)
ReDim d4#(tenmegabyte)

ReDim b5!(tenmegabyte)
ReDim c5&(tenmegabyte)
ReDim d5#(tenmegabyte)

ReDim b6!(tenmegabyte)
ReDim c6&(tenmegabyte)
ReDim d6#(tenmegabyte)

ReDim b7!(tenmegabyte)
ReDim c7&(tenmegabyte)
ReDim d7#(tenmegabyte)

Text1(0).Text = "Single : 320 megabytes"
Text1(1).Text = "Long : 320 megabytes"
Text1(2).Text = "Double : 640 megabytes"

Text1(0).Refresh
Text1(1).Refresh
Text1(2).Refresh

iloop = 0
On Error GoTo handler
Do
    a$ = a$ & Space$(onemegabyte)
    iloop = iloop + 1
    Text1(3).Text = iloop & " megabytes (*2)"
    Text1(3).Refresh
Loop

handler:
a$ = ""
Text1(4).Text = "Total : " & 320 + 320 + 640 + iloop * 2 & " megabytes"

End Sub

Private Sub Form_Load()
Command1.Caption = "Create Large String"
End Sub
