Vb.Net action delegate problem?

Posted by Ramesh Vel on Stack Overflow See other posts from Stack Overflow or by Ramesh Vel
Published on 2010-05-07T06:54:13Z Indexed on 2010/05/07 6:58 UTC
Read the original article Hit count: 210

Filed under:
|

Hi, Am vb.net newbie. This question might be very novice and answered before, but i couldn't find. I was trying the lambda features and got struck here.

 Private Function HigerOrderTest(highFunction as Func(Of Int16,Int16)) As Action(of String)
  Dim sam = highFunction(3)    
  Dim DoIt as Action(of String)
  DoIt = sub(s) console.WriteLine(s)            
    return DoIt  
 End Function

I got "Expression expected." at line DoIt = sub(s) console.WriteLine(s). And when i changed this to DoIt = function(s) console.WriteLine(s) i got Expression does not produce a value. error. Whats the problem?

Cheers

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about action