how to break apart regexoptions?

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top