Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Syntax Error

  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Syntax Error

    Hi!

    I have a problem -this script returns the following error when executing:
    Code:
    Microsoft VBScript compilation error '800a03ea' 
    
    Syntax error 
    
    /compserver/head.asp, line 2 
    
    Function StatusBarText(strText)
    ^
    This is my code:
    PHP Code:
    <%
        ~~~ 
    ASP statements (DB managementcalculations,...) ~~~
        
        
    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
    Last edited by bostjank; 02-06-2003 at 11:12 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •