|
Honestly one of my favourite ways to put arguments in functions as it allows maximum flexibility.
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
"When you have eliminated the JavaScript, whatever remains must be an empty page." -- Mike Hankey
If a coffee bean is between the Earth and the Sun, is it a Java Eclipse? -- Sascha Lefèvre
/xml>
|
|
|
|
|
me too!
|
|
|
|
|
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
|
That's the proper solution.
|
|
|
|
|
Would you want to seal that? Or might you want to make an Interface?
|
|
|
|
|
Except when the name too long
For instance
BigLongClassNameThatDoesLotsOfStuff.DoLotsOfStuffLongCallFunctionUpdateArgs args
|
|
|
|
|
enum class MostlyHarmlessFuncArg : bool { vanilla=false, FireMeIfYouCatchMeUsingThis = true };
|
|
|
|
|
I've used a similar approach occasionally:
class DoProcArgs
{
public bool UpdatesLiveDB { set; get; };
public int Response { set; get; };
public string BlahBlahBlah { set; get; };
public DoProcArgs()
{
UpdatesLiveDB = false;
Response = 42;
BlahBlahBlah = "Meh";
}
}
void DoProc(DoProcArgs);
DoProc(new DoProcArgs() { Response = 84 });
DoProc(new DoProcArgs() { BlahBlahBlah = "Yup", UpdatesLiveDB = true }); This works in Visual C# 2008. Visual C# 2010 introduced named and optional arguments[^].
Software Zen: delete this;
|
|
|
|
|
enum s, maybe. Pity about automatic conversions.
enum DangerLevel
{
Safe,
FamilyJewelsInASling
};
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
And we just call this argument "Gladys"?
And is this the right forum for an argument?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: And is this the right forum for an argument? Well, do you want to have the full argument, or were you thinking of taking a course?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
I'm sorry is this the five minute argument or are you here for the full half hour?
|
|
|
|
|
I've told you once.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Yes I did!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
No you didn't. (Spam, spam, spam, spam, spam, spam, spam, spam?)
|
|
|
|
|
This argument is no more. It's expired and gone to meet its maker. This is a late argument. It's a stiff. Bereft of life, it rests in peace. If you hadn't nailed it to the thread, it would be pushing up the daisies. It's rung down the curtain and joined the choir invisible. This is an ex-argument.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
And now for something completely different.
|
|
|
|
|
RUs123 wrote: And now for something completely different. A man with a tape recorder up his nose?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
A hovercraft full of eels.
|
|
|
|
|
And now:
Number 1 - The LARCH!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Johnny J. wrote: A man with a tape recorder up his nose? Tell me it snot so!
(Please speak a bit louder and directly to my face, thank you)
Sniffle.
Sorry - what was that, again?
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
OriginalGriff wrote: "Gladys"
Special *characters* not allowed
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
OriginalGriff wrote: And we just call this argument "Gladys"?
Or (as per your post above this one) if via Microsoft, it would be called "gladys".
|
|
|
|