-
To tell the thruth, I'm almost ashamed to ask such a question, but I haven't have much of a choice...
I want to know how to call a Sub from an object.
I've got no trouble calling on functions, yet when I call on a Sub,
IE : Generator.GenerateVariables(Param1, Param2)
I get an error :" = Excepted"
Does that mean VB believe it isn't a Sub, rather a property ??
I can't figure this out...
-
Its because the sub you are calling contains (). (make sure inside here is empty).
for example:
Generator.GenerateVariables(Param1, Param2)
should be:
Generator.GenerateVariables()
Don't ask me why
[This message has been edited by rino_2 (edited 01-30-2000).]
-
why does that happen? even if it isn't supposed to return something it still asks for an = sign. call it like this:
sub num1, num2
instead of
sub(num1,num2)
that should solve your problem
-
Actually, it's because when you put parenthesies around your Parameters VB expects you to return a Value which it then has to assign, hence it tells you "=" is expected.
2 Ways to avoid this,
1) Use Call, ie. Call Generator.GenerateVariables(Param1, Param2)
or..
2) Remove the Parenthesies, ie. Generator.GenerateVariables Param1, Param2
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]