Erik Porter's Blog

Life and Development at Microsoft and Other Technology Discussions

News

    Multiple Attributes

    One more quickie I just thought of, you can now in VB 2005 have multiple attributes on different lines.

    This will work in VB 2005, but not previous versions.

    <Attribute1()> _
    <Attribute2()> _
    Public Class
    Test

    End Class

    Previously, you'd have to do it like this...

    <Attribute1(), Attribute2()> _
    Public Class
    Test

    End Class

    Kind of cool!  :)  This way you can write it either way now and I'd imagine it makes it easier for code generation tools to dump out attributes.

    Posted: Jun 14 2004, 03:59 PM by HumanCompiler | with 3 comment(s)
    Filed under: ,

    Comments

    Adam said:

    You can have multiple attributes on separate lines in VB prior to 2005, you just have to use only one set of < and >

    <Serializable(), _
    CLSCompliant(True)> _
    Class SomeClass

    End Class
    # June 14, 2004 8:40 PM

    HumanCompiler said:

    True, true, but it doesn't look very pretty ;)
    # June 14, 2004 8:44 PM

    TrackBack said:

    Filling in the gaps...
    # June 15, 2004 4:47 PM