I don't found a way to create a method can takes optional arguments.
In Cobra has this able?
Forums
Defining optional parameters
4 posts
• Page 1 of 1
Re: Defining optional parameters
Yes it does.
Have a look at the methods wiki page under 'Method paramlist' and <ParamDesc>
Theres a small example in the Examples section following
I think theres also a longer example in the
Howto section of the Doc
How to Declare a variable number of args
( If thats not clear enough query back in this topic and I'll go through it here and try and fixup the wiki page so it is ... )
Have a look at the methods wiki page under 'Method paramlist' and <ParamDesc>
Theres a small example in the Examples section following
I think theres also a longer example in the
Howto section of the Doc
How to Declare a variable number of args
( If thats not clear enough query back in this topic and I'll go through it here and try and fixup the wiki page so it is ... )
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: Defining optional parameters
I had in mind example like for c#:
- Code: Select all
public static void ExampleMethodWithDefiningOptionalParameters(string name = "Default name")
{
_name = name;
}
Sorry for my bad English.
- Ajrat
- Posts: 8
Re: Defining optional parameters
Oh - named method parameters.
No cobra doesnt support this. ( not at the moment at least )
No cobra doesnt support this. ( not at the moment at least )
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests