home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH9 / 9-2-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-21  |  1.8 KB  |  60 lines

  1. VERSION 5.00
  2. Begin VB.Form frm9_2_2 
  3.    Caption         =   "Three Colleges"
  4.    ClientHeight    =   1572
  5.    ClientLeft      =   1152
  6.    ClientTop       =   2220
  7.    ClientWidth     =   5844
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   7.8
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   1572
  20.    ScaleWidth      =   5844
  21.    Begin VB.PictureBox picOutput 
  22.       Height          =   855
  23.       Left            =   120
  24.       ScaleHeight     =   804
  25.       ScaleWidth      =   5484
  26.       TabIndex        =   1
  27.       Top             =   600
  28.       Width           =   5532
  29.    End
  30.    Begin VB.CommandButton cmdDisplay 
  31.       Caption         =   "Display Colleges"
  32.       Height          =   375
  33.       Left            =   1800
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   1695
  37.    End
  38. Attribute VB_Name = "frm9_2_2"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdDisplay_Click()
  44.   Call DisplayFile
  45. End Sub
  46. Private Sub DisplayFile()
  47.   Dim recordNum As Integer
  48.   'Access the random-access file COLLEGES.TXT
  49.   Dim college As collegeData
  50.   Open App.Path & "\COLLEGES.TXT" For Random As #1 Len = Len(college)
  51.   picOutput.Cls
  52.   picOutput.Print "College"; Tab(30); "State", Tab(45); "Year founded"
  53.   For recordNum = 1 To 3
  54.     Get #1, recordNum, college
  55.     picOutput.Print college.nom; Tab(30); college.state; Tab(45); _
  56.                     college.yrFounded
  57.   Next recordNum
  58.   Close #1
  59. End Sub
  60.