Classic ASP, Programming, SQL Server 7, VBScript, Visual Interdev, Web Development

Classic ASP Revisited: A Simple Name Parsing Function

Classic ASP Revisited
Classic ASP Revisited

Recently I was asked to update our homegrown timesheet application that had been written years ago in classic ASP. The update was simply to take a user name in the string format ‘Last Name, First Name’ and convert this to our company standard email format of FirstLetterofFirstName + LastName + @companyname.com

Now it has been years since I wrote any classic ASP, so it took a little bit of looking into the various functions to refresh my memory.

I made use of the following Classic ASP functions:

  • On Error Resume Next – to imitate¬†standard try – catch block behavior
  • The Split(BaseString, Separator) function to separate the name string
  • The Left( function to get the first letter of the first name from the string array
  • The UBound( function to get the last entry in the name array
  • The Replace(BaseString, StringToBeReplaced, ReplacementString)
  • The LCase( function. Alternately I remember also finding the UCase function to be quite useful on occasion.

Here is a test version of the code snippet I ended up using: Continue reading “Classic ASP Revisited: A Simple Name Parsing Function”