borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Disable Right Click)Next Topic (List of active tasks in Win98) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Error in class
Poster Message
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876

icon Error in class

hello... i've enccountered an error in my program.

i made access to a class module within the project, and when i run the program, having used one function of the module, i get this error:

no error number.

expected function or variable.

what does it mean?
how can i solve this problem?

thanks.

____________________________
Been busy trying to take a second degree <--it's not working out...

03-12-2002 at 05:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Error in class

Never seen it offhand...

If the class module is in the program (and not in a separate DLL/OCX), have you tried to run the program with "Break on All Errors" in error trapping, or just stepping line by line through the code once it hits the class?

I'm of course assuming that the class you're trying to access has a variable assigned to it, and the routine your trying to access does exist.


The help file makes the error seem like you're trying to reference a routine that doesn't exist, or assigning a value to a routine that isn't a (Let/Get/Set) property.


[Edited by JLRodgers on 02-12-2002 at 11:39 PM GMT]

03-12-2002 at 05:38 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: Error in class

JL, it happens that my error doesn't come up as a yellow highlight. that highlight comes in the containing procedure...

what the highlight goes to is that function after the 'cls.' and it's highlighted in blue.

i really don't get it. no let get set. just that it is a public sub, and i set it to a long variable.

my other functions work fine, but this particular one doesn't give in!

____________________________
Been busy trying to take a second degree <--it's not working out...

03-12-2002 at 05:54 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Error in class

Could you post the code? It would be easier to find the error.

[Hope it's a public function that has a long not a sub.]

It wouldn't happen to be a "reserved" VB word would it (the routine name)? You may want to try to run with compile (CTRL-F5) to see if any error popups then too (it would eliminate any problems with the declaration of the routine - syntax)

And if you're passing a variable that's a defined type [array, or anything with multiple parts] to the function, it has to be ByRef, not Byval. Not that it's that, but potential problems that don't show up until accessing the routine, or "running with compile".

03-12-2002 at 06:43 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: Error in class

hey, JL... yep, i got mixed up with a ByRef but i got to solve the particular problem i asked help for.. and i'd like to post it a well so that others can refer to this.

when the error

Expected Function or variable


came up, i found that i had not yet set reference to the scripting dll in the reference menu of the project.

but, hey, thanks! you gave me a point with the ByRef  

____________________________
Been busy trying to take a second degree <--it's not working out...

03-12-2002 at 05:35 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Error in class
Previous Topic (Disable Right Click)Next Topic (List of active tasks in Win98) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder