www.webdeveloper.com
Results 1 to 1 of 1

Thread: Type Mismatch due to missing function

  1. #1
    Join Date
    Jul 2005
    Location
    Michigan
    Posts
    43

    Type Mismatch due to missing function

    I wonder if anyone could help me figure out how to get around this problem:

    (1) I have an #include file that is included on several pages.

    (2) The #include contains a reference to a function. Could be something as simple as:

    Code:
    <%
    x=CategoryNews(a,b,c)
    %>
    (3) The problem is that not all pages include the code that contains the function CategoryNews. On those pages that don't include the function, a Type Mismatch error occurs.

    So the question is: How can I modify the script so that it will check whether the function exists before continuing?

    Psuedo code:

    Code:
    <%
    If CategoryNews.Exists Then
        x=CategoryNews(a,b,c)
    End If 
    %>
    I've googled for a solution to this problem but haven't been able to find the answer. Any assistance would be greatly appreciated!


    UPDATE:

    As a temporary workaround, I've added a boolean variable to the file that contains the CategoryNews function, and I check the status of that variable before executing the rest of the code, like this:


    Code:
    <%
    If blnNewsFunctionsExist Then
        x=CategoryNews(a,b,c)
    End If 
    %>
    But it seems like there should be a more direct way to check whether the function being called actually exists.
    Last edited by -asx-; 07-16-2013 at 06:28 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles