• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

What dos this syntax mean: Default = f.@default == "yes"

Default is a boolean but I am confused by the @ in front of "default".

Is that just the variable name?

It follows this line:
        [System.Xml.Serialization.XmlAttributeAttribute()]

Thanks.
0
newbieweb
Asked:
newbieweb
2 Solutions
 
HainKurtSr. System AnalystCommented:
Default = f.@default == "yes"

-->

Default = (f.@default == "yes")

-->

if (f.@default == "yes") then Default = true else Default=false
0
 
newbiewebAuthor Commented:
Yes, I understand C#.

I was asking about the @ in front of default.
0
 
Bill NolanCommented:
It allows you to use a reserved word.  E.g., the following won't compile:

int default = 1;
0
 
Jacques Bourgeois (James Burger)Commented:
default is a reserved word in C#.

Adding @ in front of a property or method name enables you to use a word that would not be usable otherwise.

Having a property called default is not permitted, because it is a reserved word, but @default is accepted.

Search for "C# Keywords" in the documentation and give a look at the first paragraph.
0
 
newbiewebAuthor Commented:
Thanks. I now remember I used to know that :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now