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

  1. VERSION 5.00
  2. Begin VB.Form frm6_3_3 
  3.    Caption         =   "Write Backwards"
  4.    ClientHeight    =   1710
  5.    ClientLeft      =   1545
  6.    ClientTop       =   1755
  7.    ClientWidth     =   3240
  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     =   1710
  20.    ScaleWidth      =   3240
  21.    Begin VB.TextBox txtWord 
  22.       Height          =   285
  23.       Left            =   720
  24.       TabIndex        =   0
  25.       Top             =   210
  26.       Width           =   2415
  27.    End
  28.    Begin VB.CommandButton cmdReverse 
  29.       Caption         =   "Reverse Letters"
  30.       Height          =   495
  31.       Left            =   120
  32.       TabIndex        =   1
  33.       Top             =   720
  34.       Width           =   3015
  35.    End
  36.    Begin VB.PictureBox picTranspose 
  37.       Height          =   255
  38.       Left            =   360
  39.       ScaleHeight     =   195
  40.       ScaleWidth      =   2475
  41.       TabIndex        =   2
  42.       Top             =   1320
  43.       Width           =   2535
  44.    End
  45.    Begin VB.Label lblWord 
  46.       Alignment       =   1  'Right Justify
  47.       Caption         =   "Enter Word"
  48.       Height          =   495
  49.       Left            =   0
  50.       TabIndex        =   3
  51.       Top             =   120
  52.       Width           =   615
  53.    End
  54. Attribute VB_Name = "frm6_3_3"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. Private Sub cmdReverse_Click()
  60.   picTranspose.Cls
  61.   picTranspose.Print Reverse(txtWord.Text)
  62. End Sub
  63. Private Function Reverse(info As String) As String
  64.   Dim m As Integer, j As Integer, temp As String
  65.   m = Len(info)
  66.   temp = ""
  67.   For j = m To 1 Step -1
  68.     temp = temp + Mid(info, j, 1)
  69.   Next j
  70.   Reverse = temp
  71. End Function
  72.