Hi guys!
I want to apply this attribute to a property :
[Option('i',"input",Required := true, HelpText := "Input file to read.")];
But I get this error:
XS0182 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
What am I doing wrong?
TIA
Meinhard
Use of Attributes
Use of Attributes
Meinhard,
What happens if you use "i" in stead of 'i' ?
Robert
What happens if you use "i" in stead of 'i' ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Use of Attributes
Hi Meinhard,
a complete shot in the dark (before Robert gives the right answer):
I would try
Wolfgang
a complete shot in the dark (before Robert gives the right answer):
I would try
Code: Select all
[Option{'i',"input",Required := true, HelpText := "Input file to read."}]
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Use of Attributes
Hi Robert,
same message.
Regards
Meinhard
same message.
Regards
Meinhard
Use of Attributes
Hi Wolfgang,
already tried, but accroding to the grammar this is invalid syntax anyway.
Regards
Meinhard
already tried, but accroding to the grammar this is invalid syntax anyway.
Regards
Meinhard
Use of Attributes
Meinhard,
what type is the OptionAttribute ?
And what happens if you omit one or more values from the definition ?
Can you send me the assembly that defines the optionattribute class ?
Robert
what type is the OptionAttribute ?
And what happens if you omit one or more values from the definition ?
Can you send me the assembly that defines the optionattribute class ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Use of Attributes
Hi Robert,
just sent you the complete solution (small) via email.
TIA & Regards
Meinhard
just sent you the complete solution (small) via email.
TIA & Regards
Meinhard
Use of Attributes
For those reading :
We have found the problem with Meinhards code: there is a problem handling literal character values in Attributes and Switch statements.
In this case the OptionAttribute class expects a literal character followed by a literal string, and this is not handled properly by the compiler.
We will fix this asap.
Robert
We have found the problem with Meinhards code: there is a problem handling literal character values in Attributes and Switch statements.
In this case the OptionAttribute class expects a literal character followed by a literal string, and this is not handled properly by the compiler.
We will fix this asap.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Use of Attributes
Hi,
again this fast reaction of the development team confirms my decision to use X# as my primary development tool.
Wolfgang
again this fast reaction of the development team confirms my decision to use X# as my primary development tool.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it