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 04-08-2021

    Carbon neutral cement - by extracting lime from seawater (tags: co2 cement materials ) Middle Pleistocene fire use: The first signal of…

  • Interesting Links for 03-08-2021

    I think these people have opened a door into the void. Or the elemental plane of storms. Either way: don't! (tags: weather video ) Government…

  • Interesting Links for 02-08-2021

    Salem Almuzaini's account of brutal torture in Saudi captivity reveals extent of MBS regime's brutal conduct (tags: saudiarabia torture )…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 34 comments

  • Interesting Links for 04-08-2021

    Carbon neutral cement - by extracting lime from seawater (tags: co2 cement materials ) Middle Pleistocene fire use: The first signal of…

  • Interesting Links for 03-08-2021

    I think these people have opened a door into the void. Or the elemental plane of storms. Either way: don't! (tags: weather video ) Government…

  • Interesting Links for 02-08-2021

    Salem Almuzaini's account of brutal torture in Saudi captivity reveals extent of MBS regime's brutal conduct (tags: saudiarabia torture )…