vb.net - What's the deal with this Lambda? -


Func (integer, boolean) = function (integer as x) x = 1 if (count)

  (GetSelectedCount ()) Then go ahead 'MessageBox.Show ("You can select only one item at a time.", "Multiple items selected", MessageBoxButtons.OK) if  
< P> GetSelectedCount Returns the number of items checked in a grid. It gives 0 when nothing is chosen, Lambda is supposed to return only the truth when only 1 item is selected. The message box should be run only when> 1 item is selected

Decision to solve Lemmda leaving and going to old school

  Choose Case GetelectedCount () Case 1 is the case & gt; ; 1 MessageBox.Show ("You can select only one item at a time.", "Multiple Selection", MessageBoxButtons.OK) Episode Other Message Box ("You have no items selected.", "No selection", message box button. OK) Select  

= The operator pulls double duty for both work and parity in VB. met. Is it possible to interpret it incorrectly as an assignment? Try it instead:

  Slow calculation (integer, boolean) = function as function (return x as integer) returns x = 1  

Comments