Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

how to break apart regexoptions?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GS - 10 Jun 2007 07:29 GMT
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] - 10 Jun 2007 14:55 GMT
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.

Signature

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

>I got a bunch of check boxes to represent regexoptions. converting that to
> one single regexoptions for storing in the database is easy.
[quoted text clipped - 3 lines]
> can't  or at least I don't know how to perform bitwise op on int or
> regexoptions?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.