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 / CH3 / 3-6-6.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-17  |  2.2 KB  |  72 lines

  1. VERSION 5.00
  2. Begin VB.Form frm3_6_6 
  3.    Caption         =   "3-6-6"
  4.    ClientHeight    =   1095
  5.    ClientLeft      =   1065
  6.    ClientTop       =   1590
  7.    ClientWidth     =   4920
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  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     =   1095
  20.    ScaleWidth      =   4920
  21.    Begin VB.PictureBox picResults 
  22.       Height          =   495
  23.       Left            =   2280
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   2475
  26.       TabIndex        =   3
  27.       Top             =   480
  28.       Width           =   2535
  29.    End
  30.    Begin VB.CommandButton cmdAnalyze 
  31.       Caption         =   "Analyze Name"
  32.       Height          =   375
  33.       Left            =   120
  34.       TabIndex        =   2
  35.       Top             =   480
  36.       Width           =   2055
  37.    End
  38.    Begin VB.TextBox txtFullName 
  39.       Height          =   285
  40.       Left            =   2400
  41.       TabIndex        =   1
  42.       Top             =   120
  43.       Width           =   2415
  44.    End
  45.    Begin VB.Label lblName 
  46.       Caption         =   "Name (first and last only):"
  47.       Height          =   255
  48.       Left            =   120
  49.       TabIndex        =   0
  50.       Top             =   120
  51.       Width           =   2295
  52.    End
  53. Attribute VB_Name = "frm3_6_6"
  54. Attribute VB_GlobalNameSpace = False
  55. Attribute VB_Creatable = False
  56. Attribute VB_PredeclaredId = True
  57. Attribute VB_Exposed = False
  58. Private Sub cmdAnalyze_Click()
  59.   Dim nom As String    'Name
  60.   Dim n As Integer     'Location of space
  61.   Dim first As String  'First name
  62.   Dim last As String   'Last name
  63.   'Evaluate functions at variables and expressions.
  64.   picResults.Cls
  65.   nom = txtFullName.Text
  66.   n = InStr(nom, " ")
  67.   first = Left(nom, n - 1)
  68.   last = Right(nom, Len(nom) - n)
  69.   picResults.Print "Your first name is "; first
  70.   picResults.Print "Your last name has"; Len(last); "letters."
  71. End Sub
  72.