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:
<%
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:
<%
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:
<%
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.