Hi!
I'm not sure what I'm doing wrong.
I can't find the someEnum.hasFlag(flag) method, that is available in .net 4.
is there a ref I need to add?
is System.Core and cobra.core the same?
thanks for the help
kobi
Forums
enum flags
4 posts
• Page 1 of 1
enum flags
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
Truth, Compassion, Forbearance is Good.
- kobi7
- Posts: 82
- Location: Israel
Re: enum flags
Cobra does not currently pick up on .hasFlag. You can use the bitwise and-operator (&) to test flags, same as in most languages and documented here:
http://cobra-language.com/trac/cobra/wiki/Enum
http://cobra-language.com/trac/cobra/wiki/Enum
if someThing & Thing.Foo, print 'test passed'
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: enum flags
Thanks Charles.
I thought cobra has full interoperability with the .net library.. that was the misunderstanding.
some usings are auto-loaded in C# (System, I think)
so my thinking was that Enum is hiding there, while in cobra I should be explicit with "use" in order to have it.
can you clarify on that regard? thanks!
I thought cobra has full interoperability with the .net library.. that was the misunderstanding.
some usings are auto-loaded in C# (System, I think)
so my thinking was that Enum is hiding there, while in cobra I should be explicit with "use" in order to have it.
can you clarify on that regard? thanks!
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
Truth, Compassion, Forbearance is Good.
- kobi7
- Posts: 82
- Location: Israel
Re: enum flags
oh, I now read what you pointed to.
so you built flag checking into the language - very nice!
hurray to less cryptic syntax
so you built flag checking into the language - very nice!
hurray to less cryptic syntax
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
Truth, Compassion, Forbearance is Good.
- kobi7
- Posts: 82
- Location: Israel
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 26 guests