Sorry, there are further mistakes, I really didn't think when doing this one.
The case statement should be from a base of 0 (zero)
so
case 1
case 2
...etc
should be case 0, case 1, ...etc.
Below is working code to illustrate clearly
Code:
<% @language = "vbscript" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Dim arrFullName
dim strName
'split the full name into the array
strName = "John Markus K Philip"
arrFullName = split(strName," ")
'check how many elements are in the array
select case ubound(arrFullName)
case 0
'Code to handle one name entered
var1 = arrFullName(0)
case 1
'code to handle two names entered
var1 = arrFullName(0)
var2 = arrFullName(1)
case 2
'code to handle three names entered
var1 = arrFullName(0)
var2 = arrFullName(1)
var3 = arrFullName(2)
case 3
'code to handle Four names entered
var1 = arrFullName(0)
var2 = arrFullName(1)
var3 = arrFullName(2) & " " & arrFullName(3)
end select
response.write("<BR>Var1 = " & var1)
response.write("<BR>Var1 = " & var2)
response.write("<BR>Var1 = " & var3)
%>
</body>
</html>
======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================