Home All Groups Group Topic Archive Search About
Author
18 Jan 2006 11:44 AM
kurt sune
VB is supposed to have free format.

I have tried, most for fun, to write a property on ONE line.

I have not succeded.

Can you?

<Bindable(False), _

Description("Sets the CSS class of the button."), _

Category("CssClasses"), _

DefaultValue("")> _

Public Property CssClassButton() As String

Get

Return _CssClassButton

End Get

Set(ByVal Value As String)

_CssClassButton = Value

End Set

End Property

Author
18 Jan 2006 11:55 AM
Armin Zingler
"kurt sune" <a**@apa.com> schrieb
> VB is supposed to have free format.

What is "free format"?

> I have tried, most for fun, to write a property on ONE line.

This is not possible.

Show quoteHide quote
> I have not succeded.
>
> Can you?
>
> <Bindable(False), _
>
> Description("Sets the CSS class of the button."), _
>
> Category("CssClasses"), _
>
> DefaultValue("")> _
>
> Public Property CssClassButton() As String
>
> Get
>
> Return _CssClassButton
>
> End Get
>
> Set(ByVal Value As String)
>
> _CssClassButton = Value
>
> End Set
>
> End Property


See also:
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec12.asp


Armin
Author
18 Jan 2006 12:05 PM
Larry Lard
kurt sune wrote:
> VB is supposed to have free format.

No it isn't, at least VB.NET isn't. There are plenty of places where a
newline is syntactically necessary. In general, the Basic family of
languages has always been line-oriented. The C family of languages has
generally been character-oriented, and I believe C# retains this: you
can write perfectly acceptable C# programs on one line, if you want.

You would hate Python.

--
Larry Lard
Replies to group please
Author
18 Jan 2006 12:07 PM
Patrice
What about telling us the error you see ? You may have a problem in the
surrounding code. Works here...

--
Patrice

Show quoteHide quote
"kurt sune" <a**@apa.com> a écrit dans le message de
news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl...
> VB is supposed to have free format.
>
> I have tried, most for fun, to write a property on ONE line.
>
> I have not succeded.
>
> Can you?
>
> <Bindable(False), _
>
> Description("Sets the CSS class of the button."), _
>
> Category("CssClasses"), _
>
> DefaultValue("")> _
>
> Public Property CssClassButton() As String
>
> Get
>
> Return _CssClassButton
>
> End Get
>
> Set(ByVal Value As String)
>
> _CssClassButton = Value
>
> End Set
>
> End Property
>
>
Author
19 Jan 2006 7:43 AM
kurt sune
This code:
Public Overrides Property CssClass() As String : Get

End Get

Set(ByVal Value As String)

End Set

End Property



returns this error: "Method declaration statements must be the first
statement on a logical line"



/k



Show quoteHide quote
"Patrice" <a@bc.c> wrote in message
news:Ot7BJfCHGHA.1396@TK2MSFTNGP11.phx.gbl...
> What about telling us the error you see ? You may have a problem in the
> surrounding code. Works here...
>
> --
> Patrice
>
> "kurt sune" <a**@apa.com> a écrit dans le message de
> news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl...
> > VB is supposed to have free format.
> >
> > I have tried, most for fun, to write a property on ONE line.
> >
> > I have not succeded.
> >
> > Can you?
> >
> > <Bindable(False), _
> >
> > Description("Sets the CSS class of the button."), _
> >
> > Category("CssClasses"), _
> >
> > DefaultValue("")> _
> >
> > Public Property CssClassButton() As String
> >
> > Get
> >
> > Return _CssClassButton
> >
> > End Get
> >
> > Set(ByVal Value As String)
> >
> > _CssClassButton = Value
> >
> > End Set
> >
> > End Property
> >
> >
>
>
Author
19 Jan 2006 9:01 AM
Patrice
IMO, expected for this one : is the separator for *executable* statements.
I'm not really suprised it doesn't work in a declaration statement.


--
Patrice

Show quoteHide quote
"kurt sune" <a**@apa.com> a écrit dans le message de
news:Ox2V7vMHGHA.3120@TK2MSFTNGP10.phx.gbl...
> This code:
> Public Overrides Property CssClass() As String : Get
>
> End Get
>
> Set(ByVal Value As String)
>
> End Set
>
> End Property
>
>
>
> returns this error: "Method declaration statements must be the first
> statement on a logical line"
>
>
>
> /k
>
>
>
> "Patrice" <a@bc.c> wrote in message
> news:Ot7BJfCHGHA.1396@TK2MSFTNGP11.phx.gbl...
> > What about telling us the error you see ? You may have a problem in the
> > surrounding code. Works here...
> >
> > --
> > Patrice
> >
> > "kurt sune" <a**@apa.com> a écrit dans le message de
> > news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl...
> > > VB is supposed to have free format.
> > >
> > > I have tried, most for fun, to write a property on ONE line.
> > >
> > > I have not succeded.
> > >
> > > Can you?
> > >
> > > <Bindable(False), _
> > >
> > > Description("Sets the CSS class of the button."), _
> > >
> > > Category("CssClasses"), _
> > >
> > > DefaultValue("")> _
> > >
> > > Public Property CssClassButton() As String
> > >
> > > Get
> > >
> > > Return _CssClassButton
> > >
> > > End Get
> > >
> > > Set(ByVal Value As String)
> > >
> > > _CssClassButton = Value
> > >
> > > End Set
> > >
> > > End Property
> > >
> > >
> >
> >
>
>
Author
19 Jan 2006 11:01 AM
Armin Zingler
Show quote Hide quote
"kurt sune" <a**@apa.com> schrieb im Newsbeitrag
news:Ox2V7vMHGHA.3120@TK2MSFTNGP10.phx.gbl...
> This code:
> Public Overrides Property CssClass() As String : Get
>
> End Get
>
> Set(ByVal Value As String)
>
> End Set
>
> End Property
>
>
>
> returns this error: "Method declaration statements must be the first
> statement on a logical line"

Maybe you overlooked the link I gave in my previous post because It was at
the bottom:
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec12.asp


Armin
Author
18 Jan 2006 12:22 PM
Ken Tucker [MVP]
Hi,

        That should work. You will need imports system.componentmodel at the
top of the file for the attributes to work.

Ken
----------------------
Show quoteHide quote
"kurt sune" <a**@apa.com> wrote in message
news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl...
> VB is supposed to have free format.
>
> I have tried, most for fun, to write a property on ONE line.
>
> I have not succeded.
>
> Can you?
>
> <Bindable(False), _
>
> Description("Sets the CSS class of the button."), _
>
> Category("CssClasses"), _
>
> DefaultValue("")> _
>
> Public Property CssClassButton() As String
>
> Get
>
> Return _CssClassButton
>
> End Get
>
> Set(ByVal Value As String)
>
> _CssClassButton = Value
>
> End Set
>
> End Property
>
>