views:

478

answers:

2

Hello

Migrating an old ASP site to .NET, and there's a load of VBScript we're porting to VB.NET.

Getting into trouble with the old property syntax, does anyone know of a tool (or other such magic) that could do this automatically?

Googled, but no joy.

Thanks Duncan

EDIT: VB Script properties look like this:

Public Property Get AgeCategoryID()
 AgeCategoryID = m_AgeCategoryID
End Property
Public Property Let AgeCategoryID(Value)
 m_AgeCategoryID=Value
End Property

VB.NET properties look like this:

Public Property ParticipationTypeID()
    Get
        Return m_ParticipationType
    End Get
    Set(ByVal value)
        m_ParticipationType = value
    End Set
End Property

Other than convert them by hand, and there are lots, is there anything I can do to speed up the process?

+1  A: 

I don't know of any tool that is designed to take ASP (or at least VBScript) and convert to VB.NET. However VS does have a tool for converting VB6 to VB.NET. It may be possible for you massage (or at least cut'n'paste) chuncks of you VBScript and pretend its VB6 code, then get the tool convert it. It'll still be very messy but it may help reduce the some handle turning.

Another approach is to write a macro to find and convert pairs of Property definitions, although in my experience such efforts tend to take as much time (due to large amounts of debugging) as the brute force handle turning approach.

AnthonyWJones
Yeah, that's been my findings so far.Just have to get on with it I think :(
Duncan
A: 

Found what I was looking for - it's in Visual Studio, Tools | Upgrade VB6 code.

Not perfect but will save a lot of time.

Duncan