Hi,
"Hugo Wetterberg" <hu************ *@smi.mas.lu.se > wrote in message
news:1w******** *************** *****@40tude.ne t...
A constructor always constructs an object. In the constructor for B, you
could do this
public B()
{
A obj=new A(modifiedValue );
}
This will create a new instance of A local to the constructor of B, this has
nothing to do with the original post, it does not contribute to the
construction of B.
Regarding the original post.
It will not work that way, You have two options though.
If the modifications of the parameter does not imply calling a method of B
you can do so in the constructor like this:
public B( string c): base( c.SubString( 1,2 ) )
{}
if the string used in A is generated by some method in B you CANNOT do
something like:
public B( string c): base( MethodOfB( ) ) {}
if MethodOfB is an instance member cause B is not yet build.
But you can do that if MethodOfB is static :
public B( string c): base( MethodOfB( ) ) {}
static string MethodOfB() { return "test";}
Jon:
Maybe this is a good addition to your contructor page.
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation