Re: Shorter Declaration when using For Each
From: Gerry O'Brien [MVP] (gkcomput_at_hotmail.com)
Date: 09/08/04
- Next message: Terry Olsen: "Re: RS232 Anyone???"
- Previous message: Cor Ligthert: "Re: Form Resize"
- In reply to: Raterus: "Shorter Declaration when using For Each"
- Next in thread: Raterus: "Re: Shorter Declaration when using For Each"
- Reply: Raterus: "Re: Shorter Declaration when using For Each"
- Reply: Greg Burns: "Re: Shorter Declaration when using For Each"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 8 Sep 2004 13:49:38 -0300
Certainly, .NET now allows you to do this;
For Each adminuser As String in adminusers
If username = adminuser Then
m_admin = True
End If
Next
--
Gerry O'Brien [MVP]
Visual Basic .NET
"Raterus" <moc.liamtoh@suretar.reverse> wrote in message
news:%23fzmVEclEHA.3712@TK2MSFTNGP15.phx.gbl...
Hi, is there a way I can avoid having to declare my variable I use when
using a For Each loop?
Dim adminuser As String 'I'd like to get rid of this line and
just declare it all on the next line
For Each adminuser In adminusers
If username = adminuser Then
m_admin = True
End If
Next
Thanks,
--Michael
- Next message: Terry Olsen: "Re: RS232 Anyone???"
- Previous message: Cor Ligthert: "Re: Form Resize"
- In reply to: Raterus: "Shorter Declaration when using For Each"
- Next in thread: Raterus: "Re: Shorter Declaration when using For Each"
- Reply: Raterus: "Re: Shorter Declaration when using For Each"
- Reply: Greg Burns: "Re: Shorter Declaration when using For Each"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|