passing parameters to the constructor 
Author Message
 passing parameters to the constructor

Hi All,

can i pass a parameter to a constructor? (class_initialize procedure)

i want to but i the compiler doesn't seem to want to let me do it.

thanks for any help.

nick



Sun, 14 Apr 2002 03:00:00 GMT  
 passing parameters to the constructor
If you really need that idiom define:

public function NewWhatever(Param1 as ??, Param2 as ??, etc...) as Whatever
    Set NewWhatever = new Whatever
    NewWhatever.MyInitializer Param1, Param2, etc...
end function

in some .BAS module and replace

Set X = new Whatever

with

Set X = NewWhatever("This", That", "And the other thing")


Quote:
> No you cannot. you may have to write a init(...) function yourself to
> serve this purpose. Language limitation, I would say.

> Anthony



> > Hi All,

> > can i pass a parameter to a constructor? (class_initialize procedure)

> > i want to but i the compiler doesn't seem to want to let me do it.

> > thanks for any help.

> > nick

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Mon, 15 Apr 2002 03:00:00 GMT  
 passing parameters to the constructor
No you cannot. you may have to write a init(...) function yourself to
serve this purpose. Language limitation, I would say.

Anthony



Quote:

> Hi All,

> can i pass a parameter to a constructor? (class_initialize procedure)

> i want to but i the compiler doesn't seem to want to let me do it.

> thanks for any help.

> nick

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 16 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Creating constructors with byref parameters

2. Confliction between class members and parameters of constructor.

3. how to create java objects with constructors that take parameters

4. Passing Property Descriptor to DataGridTextBoxColumn Constructor

5. Passing variables to Class Module Constructor

6. passing parameter to a parameter query

7. Passing Parameters to stored parameter queries using VB 5's Data Controls

8. passing optional parameters to the parameters collection

9. Max Number of Parameters In Parameter Passing

10. Max Number of Parameters In Parameter Passing

11. Passing Parameters into a Pass-Through Query

12. Passing parameters to SQLServer using a Pass-Through query

 

 
Powered by phpBB® Forum Software