Login | |
|
 |
Array of Objects (ERROR!) - 6/14/2001 10:56:44 AM
|
|
 |
|
| |
anton
Posts: 11
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
|
Hi -- I'm trying to create an array of objects. The number of objects needed varies from request to request, and so I assumed this would be the most efficient way to accomplish this. However, I'm getting a error that doesn't add up to me, seeing that the method I'm trying to call is explicitly a function, and not a sub(which is what the error calls it)? Anyway, take a look and post if you can help. Class declaration excerpt: class topThreeBox public currentN, previousN public currentTop, previousTop public function calcTop3Box(rs, strFieldName, intUpperBound, intLowerBound, intUpperValid, intLowerValid, strCurOrPrev) ***meat of function here*** end function end class Declaration of array: dim i, intNumOfQuestions for i = 2 to 13 if formObjectArray(i) then intNumOfQuestions = intNumOfQuestions + 1 end if next dim topBoxArray(intNumOfQuestions) set topBoxArray = new topThreeBox Trying to call the aforementioned method: topBoxArray(intTopSpot).calcTop3Box(currentRS, "Q1", 10, 1, 10, 8, "current") Resulting Error Message: Microsoft VBScript compilation error '800a0414' Cannot use parentheses when calling a Sub /heclientrg2000/calculateConcessions.inc, line 9 topBoxArray(intTopSpot).calcTop3Box(currentRS, "Q1", 10, 1, 10, 8, "current") Thanks in advance for any help!
|
|
| |
|
|
|
 |
Re: Array of Objects (ERROR!) - 6/14/2001 11:01:00 AM
|
|
 |
|
| |
cruiser
Posts: 25
Score: 0
Joined: 6/4/2001
From: USA
Status: offline
|
Hi, try this one .. ''some variable dim xyz xyz=topBoxArray(intTopSpot).calcTop3Box(currentRS, "Q1", 10, 1, 10, 8, "current") inplace of topBoxArray(intTopSpot).calcTop3Box(currentRS, "Q1", 10, 1, 10, 8, "current") in case of function u have to assign value return by function to some variable otherwise it treat function as sub.so another alternative would be it to use call like this .. call topBoxArray(intTopSpot).calcTop3Box(currentRS, "Q1", 10, 1, 10, 8, "current") I hope this will soleve your problem. anil.
|
|
| |
|
|
|
|
|