Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

Syntax I'd like to use.

Given a particular case I need to make four contols invisible.

I can just say:
control1.visible = false;
control2.visible = false;
label1.visible = false;
label2.visible = false;
but it seems awfully longwinded.

You can shorten it a bit to:
control1.Visible = control2.Visible = label1.Visible = label2.Visible = false;
but that's pretty awkward to read, and has redundancy too.

I think that C# lambda functionality would allow me to end up with code something like:
{label1,label2, control1,control2}.Set(Control c => c.visible=false;)
but that also seems pretty clunky (I can't check that syntax at work, we're using VS 2005, which doesn't support lambdas).

Is there a language that would let you do this?:
{label1,label2, control1,control2}.Visible = false;
Subscribe

  • Interesting Links for 22-10-2021

    The NFT-based book-writing group aimed at teens that lasted nearly 12 hours before being questioned to death (tags: writing cryptography wtf…

  • Interesting Links for 21-10-2021

    "i need a white guy" (tags: racism satire apps ) The government let Covid rip through our care homes (tags: OldAge murder Pandemic lies…

  • Interesting Links for 20-10-2021

    The Tragedy of The Last Duel Flopping at the Box Office (I do actually fancy this. But I'm not going to a cinema until cases are 1/20 of what they…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 34 comments

  • Interesting Links for 22-10-2021

    The NFT-based book-writing group aimed at teens that lasted nearly 12 hours before being questioned to death (tags: writing cryptography wtf…

  • Interesting Links for 21-10-2021

    "i need a white guy" (tags: racism satire apps ) The government let Covid rip through our care homes (tags: OldAge murder Pandemic lies…

  • Interesting Links for 20-10-2021

    The Tragedy of The Last Duel Flopping at the Box Office (I do actually fancy this. But I'm not going to a cinema until cases are 1/20 of what they…