...

View Full Version : Syntax Error



bostjank
02-07-2003, 12:08 AM
Hi!

I have a problem -this script returns the following error when executing:


Microsoft VBScript compilation error '800a03ea'

Syntax error

/compserver/head.asp, line 2

Function StatusBarText(strText)
^

This is my code:


<%
~~~ ASP statements (DB management, calculations,...) ~~~

Header()

~~~ Other ASP statements ~~~
%>
<% Sub Header() %>
<html>
<head>
...
</head>
<body>
<!--#include file="head.asp" -->
<% End Sub %>

********

THIS IS HEAD.ASP
<%
Function StatusBarText(strText)
If strText = "" Then
StatusBarText = "onMouseOver=""return setStatus('Click...')"" onMouseOut=""return setStatus('')"""
Else
StatusBarText = "onMouseOver=""return setStatus('" & strText & "')"" onMouseOut=""return setStatus('')"""
End If
End Function
%>
...

The error doesn't appear if I omitt SUB HEADER and just place its "content" in the place instead of Header(). But I don't want to do that - do you know the solution to the problem?

Thanks,
Bostjan

whammy
02-07-2003, 12:36 AM
Yeah, don't include a function inside a sub, that won't work.

You should be able to include it anywhere else though, I usually place functions at the top or bottom of a script.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum