Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Array of Objects (ERROR!)

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,168
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Array of Objects (ERROR!)
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 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!
 
 
Post #: 1
 
 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.

(in reply to anton)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Array of Objects (ERROR!) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts