Hello Experts,
I recently migrated to VB EXpress 2005 from VB 5.0 and am having difficulty translating old VB commands in VB 2005.
I have written the following program to analyse people's names:
Option Explicit On
Public Class Form1
Dim FirstName As String
Dim LastName As String
Dim FullName As String
Dim Space As Integer
Dim FullNameLength As Integer
Private Sub cmdInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdInfo.Click
FullName = txtName.Text
FullNameLength = Len(txtName.Text)
Space = InStr(FullName, "")
FirstName = Left(FullName, Space - 1)
LastName = Right(FullName, FullNameLength - Space)
Me.lblOutput.Text = ("your first name is " & FirstName)
Me.lblOutput.Text = ("your last name is " & LastName)
Me.lblOutput.Text = ("There are " & FullNameLength - 1 & " characters in your name"
End Sub
End Class
however, the "left" or "right" function do not work as they did in VB 5.0
I get the following error message: "Public ReadOnly left() as integer has no parameters and its return type cannot be indexed"
What am I doing wrong?
Thanks for your support.
MC
Start Free Trial