Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constructor overloading
Message
From
17/03/2005 13:14:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00996906
Message ID:
00996946
Views:
11
public myConstructor(int para0):this(para0.ToString()) {}

Cetin

>Chad and Cetin,
>
>You both replied with the correct answer to my question. The problem now is that I didn't ask the correct question <s>. I tried to simplify the code a lot so that it wouldn't be so much for me to type in the message.
>
>The real question should have been:
>
>public myConstructor(int para0)
>{
>  string passThisVariable = para0.ToString();
>  // run constructor code in constructor with string parameter
>}
>
>public myConstructor(string para0)
>{
>  // do some stuff aka. constructor code
>}
>
>
>Is this possible? What I currently do is duplicate the code in the two constructors.
>
>Sorry about not asking the correct question, but thanks for replying.
>
>Einar
>
>
>>Einar,
>>
>>I believe the syntax is:
>>
>>public myConstructor(string para0):myConstructor(para0, "einar")
>>{
>>  .....
>>
>>
>>But, it's been a while since I did this so I may be remembering incorrectly.
>>
>>HTH,
>>Chad
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform