Convert code line to VB.NET

Convert code line to VB.NET

am 30.01.2008 02:15:36 von Shapper

Hello,

I am having problems in converting the following code line to VB.NET:

Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
"MyControl"; });

Could someone please help me out?

Thanks,

Miguel

Re: Convert code line to VB.NET

am 30.01.2008 06:30:32 von naijacoder

Hope this helps mate
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
Patrick

"shapper" wrote in message
news:018eae3a-b7c1-4540-b32b-516763d1239e@s13g2000prd.google groups.com...
> Hello,
>
> I am having problems in converting the following code line to VB.NET:
>
> Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
> "MyControl"; });
>
> Could someone please help me out?
>
> Thanks,
>
> Miguel

Re: Convert code line to VB.NET

am 30.01.2008 07:09:12 von DFS

vb.net 2.0 doesn't have anonymous delegates nor closure (couldn't go a
day without them). in vb.net you have to define the function then pass
the addressof it. I never use vb.net, so don't trust my syntax completely


function delfunction(ctl as Control) as bool
return ctl.id = "MyControl"
end function

dim mylist = myfunc(mycontrol, addressof delfunc) as ...


in vb2008, just use a lambda function.

-- bruce (sqlwork.com)


dim mylist = myfunc(mycontrol
shapper wrote:
> Hello,
>
> I am having problems in converting the following code line to VB.NET:
>
> Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
> "MyControl"; });
>
> Could someone please help me out?
>
> Thanks,
>
> Miguel

Re: Convert code line to VB.NET

am 30.01.2008 12:28:06 von Shapper

On Jan 30, 6:09 am, bruce barker wrote:
> vb.net 2.0 doesn't have anonymous delegates nor closure (couldn't go a
> day without them). in vb.net you have to define the function then pass
> the addressof it. I never use vb.net, so don't trust my syntax completely
>
> function delfunction(ctl as Control) as bool
> return ctl.id = "MyControl"
> end function
>
> dim mylist = myfunc(mycontrol, addressof delfunc) as ...
>
> in vb2008, just use a lambda function.
>
> -- bruce (sqlwork.com)
>
> dim mylist = myfunc(mycontrol
>
> shapper wrote:
> > Hello,
>
> > I am having problems in converting the following code line to VB.NET:
>
> > Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
> > "MyControl"; });
>
> > Could someone please help me out?
>
> > Thanks,
>
> > Miguel

Hi,

I am using VS 2008 and .NET 3.5.
Could you tell me how the lambda function would look like in VB.NET?

I though I could use lambda only in C#.

Thanks,
Miguel

Re: Convert code line to VB.NET

am 30.01.2008 13:29:12 von nomailreplies

Did you try googling for lambda and "vb.net" ?

http://www.google.com/search?hl=en&q=lambda+%22vb.net%22




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"shapper" wrote in message news:8aaa5ac1-b04d-457b-a662-8f5174b44f94@1g2000hsl.googlegr oups.com...
> On Jan 30, 6:09 am, bruce barker wrote:
>> vb.net 2.0 doesn't have anonymous delegates nor closure (couldn't go a
>> day without them). in vb.net you have to define the function then pass
>> the addressof it. I never use vb.net, so don't trust my syntax completely
>>
>> function delfunction(ctl as Control) as bool
>> return ctl.id = "MyControl"
>> end function
>>
>> dim mylist = myfunc(mycontrol, addressof delfunc) as ...
>>
>> in vb2008, just use a lambda function.
>>
>> -- bruce (sqlwork.com)
>>
>> dim mylist = myfunc(mycontrol
>>
>> shapper wrote:
>> > Hello,
>>
>> > I am having problems in converting the following code line to VB.NET:
>>
>> > Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
>> > "MyControl"; });
>>
>> > Could someone please help me out?
>>
>> > Thanks,
>>
>> > Miguel
>
> Hi,
>
> I am using VS 2008 and .NET 3.5.
> Could you tell me how the lambda function would look like in VB.NET?
>
> I though I could use lambda only in C#.
>
> Thanks,
> Miguel

Re: Convert code line to VB.NET

am 30.01.2008 15:31:02 von Shapper

On Jan 30, 12:29 pm, "Juan T. Llibre"
wrote:
> Did you try googling for lambda and "vb.net" ?
>
> http://www.google.com/search?hl=3Den&q=3Dlambda+%22vb.net%22
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espa=F1ol :http://asp.net.do/foros/
> ==================== =====
==============
>
> "shapper" wrote in messagenews:8aaa5ac1-b04d-457b-a662=
-8f5174b44f94@1g2000hsl.googlegroups.com...
> > On Jan 30, 6:09 am, bruce barker wrote:
> >> vb.net 2.0 doesn't have anonymous delegates nor closure (couldn't go a
> >> day without them). in vb.net you have to define the function then pass
> >> the addressof it. I never use vb.net, so don't trust my syntax complete=
ly
>
> >> function delfunction(ctl as Control) as bool
> >> return ctl.id =3D "MyControl"
> >> end function
>
> >> dim mylist =3D myfunc(mycontrol, addressof delfunc) as ...
>
> >> in vb2008, just use a lambda function.
>
> >> -- bruce (sqlwork.com)
>
> >> dim mylist =3D myfunc(mycontrol
>
> >> shapper wrote:
> >> > Hello,
>
> >> > I am having problems in converting the following code line to VB.NET:=

>
> >> > Control[] list =3D MyFun(myControl, delegate(Control ctl) { ctl.ID =
==
> >> > "MyControl"; });
>
> >> > Could someone please help me out?
>
> >> > Thanks,
>
> >> > Miguel
>
> > Hi,
>
> > I am using VS 2008 and .NET 3.5.
> > Could you tell me how the lambda function would look like in VB.NET?
>
> > I though I could use lambda only in C#.
>
> > Thanks,
> > Miguel

Yes,

And I get a lot of pages with discussion of lambda in VS 2008 Beta 1,
Beta 2, ways to go ...

Do you know a page where I can see the definite way to create lambdas
en vb.net? The final release ...

Thanks,
Miguel

Re: Convert code line to VB.NET

am 30.01.2008 16:38:22 von nomailreplies

re:
!> Do you know a page where I can see the definite way to create lambdas en vb.net?
!> The final release ...

http://msdn.microsoft.com/msdnmag/issues/07/09/BasicInstinct s/

From within the VS 2008 IDE :
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vbalr/html/137064 b0-3928-4bfa-ba71-c3f9cbd951e2.htm



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"shapper" wrote in message news:1fe3aeda-ef96-469c-971e-147e4a785960@f47g2000hsd.google groups.com...
On Jan 30, 12:29 pm, "Juan T. Llibre"
wrote:
> Did you try googling for lambda and "vb.net" ?
>
> http://www.google.com/search?hl=en&q=lambda+%22vb.net%22
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en español :http://asp.net.do/foros/
> ======================================
>
> "shapper" wrote in messagenews:8aaa5ac1-b04d-457b-a662-8f5174b44f94@1g2000hsl.g ooglegroups.com...
> > On Jan 30, 6:09 am, bruce barker wrote:
> >> vb.net 2.0 doesn't have anonymous delegates nor closure (couldn't go a
> >> day without them). in vb.net you have to define the function then pass
> >> the addressof it. I never use vb.net, so don't trust my syntax completely
>
> >> function delfunction(ctl as Control) as bool
> >> return ctl.id = "MyControl"
> >> end function
>
> >> dim mylist = myfunc(mycontrol, addressof delfunc) as ...
>
> >> in vb2008, just use a lambda function.
>
> >> -- bruce (sqlwork.com)
>
> >> dim mylist = myfunc(mycontrol
>
> >> shapper wrote:
> >> > Hello,
>
> >> > I am having problems in converting the following code line to VB.NET:
>
> >> > Control[] list = MyFun(myControl, delegate(Control ctl) { ctl.ID ==
> >> > "MyControl"; });
>
> >> > Could someone please help me out?
>
> >> > Thanks,
>
> >> > Miguel
>
> > Hi,
>
> > I am using VS 2008 and .NET 3.5.
> > Could you tell me how the lambda function would look like in VB.NET?
>
> > I though I could use lambda only in C#.
>
> > Thanks,
> > Miguel

Yes,

And I get a lot of pages with discussion of lambda in VS 2008 Beta 1,
Beta 2, ways to go ...

Do you know a page where I can see the definite way to create lambdas
en vb.net? The final release ...

Thanks,
Miguel