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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Include File with Class - Syntax Error

Status
Not open for further replies.

BG12424

Programmer
Jun 4, 2002
717
US
I am getting the following error, that I can't decypher. I am including an ASP file as a include, which has a class named StringOptimizer. When I load the page, I get the following error message. Can anyone share with me where I should go to help solve this problem?
Code:
COM Error Number: -2146827286 (0x800A03EA) 
Error Source: Class StringOptimizer 
File Name: /nlt/cma/filemgmt/common.asp 
Line Number: 32 
Brief Description: Syntax error

Line 32 is the start of this Class:
Code:
Class StringOptimizer
	Dim stringArray,growthRate,numItems

	Private Sub Class_Initialize()
		growthRate = 50: numItems = 0
		ReDim stringArray(growthRate)
	End Sub

	Public Sub Append(ByVal strValue)
		' next line prevents type mismatch error if strValue is null. Performance hit is negligible.
		strValue=strValue & ""
	
		If numItems > UBound(stringArray) Then ReDim Preserve stringArray(UBound(stringArray) + growthRate)
		stringArray(numItems) = strValue: numItems = numItems + 1

	End Sub

	Public Sub Reset
		Erase stringArray
		Class_Initialize
	End Sub

	Public Function Concat() 
		Redim Preserve stringArray(numItems) 
		Concat = Join(stringArray, "")
	End Function

End Class
________________________________________________________________________
Are you trying to debug your ASP applications? See faq333-3255 for more details

regards,
Brian
 
Odd, make sure you don't have any open code blocks above this, such as functions, if statements, loops etc.
There is nothing inherently wrong with this class (though there is a slight problem passing the results back through more than one function). I did try to run a benchmark on it, but I had some problems making it return a valid result back up to the top level of my code.

-Tarwn
________________________________________________
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top