Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case syntax problem

Status
Not open for further replies.

NOPOPNOSTYLE

IS-IT--Management
Apr 9, 2002
38
GB
Hi

Below is a basic page I've written using the Select Case Statement, according to all the column inches the syntax is correct however I get a Microsoft VBScript compilation error '800a0400'.

Help

Lord Exell

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
AUPTIME=Cint(8)
Select Case(AUPTIME)
Case 4 To 5
AUPTIME_SCALE=2
Case 6 To 11
AUPTIME_SCALE=5
End Select
%>
<body>
The Score is&nbsp;<%Response.Write(AUPTIME_SCALE)'this should be writing to the screen "5"%>
<%
'below is the error message I get when I browse this page

'Microsoft VBScript compilation error '800a0400'

'Expected statement

'/case.asp, line 10

'Case 4 To 5
'-------^
%>
</body>
</html>
 
CASE ... TO syntax won't work. Use standard if-elseif-endif or CASE 4,5,6... instead.
 
Also, no parantheses are necessary for: Select Case value

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top