Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to break apart regexoptions?

7 views
Skip to first unread message

GS

unread,
Jun 10, 2007, 2:29:04 AM6/10/07
to
I got a bunch of check boxes to represent regexoptions. converting that to
one single regexoptions for storing in the database is easy.
what about the other way, from database int to regexoptions checkboxes on
the form?

can't or at least I don't know how to perform bitwise op on int or
regexoptions?


Nicholas Paldino [.NET/C# MVP]

unread,
Jun 10, 2007, 9:55:42 AM6/10/07
to
GS,

Well, if you have an integer which represents a value from the
RegexOptions from the database, you can just cast the value to the
RegexOptions instance, and it should be fine.

If you are looking to combine the checkboxes into a single value, you
can use the | operator to perform bitwise operations when making the value
to go into the database. When coming out of the database, you can use the &
operator (comparing to see if the result is equal to the value you used as
the mask) to determine if the option was picked.


--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"GS" <gsmsnews.mic...@msnews.Nomail.com> wrote in message
news:%238Ogfiy...@TK2MSFTNGP02.phx.gbl...

0 new messages