Advertisement

09.08.2007 at 06:05AM PDT, ID: 22815092
[x]
Attachment Details

Left function in VB Express 2005

Asked by MonteCristo33 in Microsoft Visual Studio Express

Tags: , , , ,

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.

MCStart Free Trial
[+][-]09.08.2007 at 06:22AM PDT, ID: 19853272

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2007 at 06:43AM PDT, ID: 19853301

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2007 at 06:54AM PDT, ID: 19853325

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Studio Express
Tags: left, vb, 2005, express, function
Sign Up Now!
Solution Provided By: FernandoSoto
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.08.2007 at 06:56AM PDT, ID: 19853329

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2007 at 09:16AM PDT, ID: 19853712

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2007 at 09:20AM PDT, ID: 19853728

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628