how to convert regexoptions value to chekcboxes

G

GS

I tried converting regexoptions to bits sp I can do bitwise operation but I
just could not get it going. I tried Google, so far I failed to find the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from database
stored as int and I am trying to represent that in check boxes. converting
int to Regexoptions is easy
 
G

GS

Hello Nicholas, I was surprised that I could not find my prev post nor
answer to it. I was it must be a mistake of mine at late Saturday night.

I was searching to my prev post and did not find it: under from: gs. I
tried also by just subject of regexoption. Total posting by me since June 9
is 3 and only today's post is on regexoptions when I searched


Something went wrong with my newsreader and searches


please repeat your answer here if you don't mind



Nicholas Paldino said:
What was wrong with my answer to your previous post?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
I tried converting regexoptions to bits sp I can do bitwise operation but I
just could not get it going. I tried Google, so far I failed to find the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from
database
stored as int and I am trying to represent that in check boxes. converting
int to Regexoptions is easy
 
N

Nicholas Paldino [.NET/C# MVP]

Here is a link to the previous response:

http://groups.google.com/group/micr...ions+Nicholas+Paldino&rnum=2#66ad7715cf3c1832


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
Hello Nicholas, I was surprised that I could not find my prev post nor
answer to it. I was it must be a mistake of mine at late Saturday night.

I was searching to my prev post and did not find it: under from: gs. I
tried also by just subject of regexoption. Total posting by me since June
9
is 3 and only today's post is on regexoptions when I searched


Something went wrong with my newsreader and searches


please repeat your answer here if you don't mind



in
message news:%[email protected]...
What was wrong with my answer to your previous post?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
I tried converting regexoptions to bits sp I can do bitwise operation
but I
just could not get it going. I tried Google, so far I failed to find the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from
database
stored as int and I am trying to represent that in check boxes. converting
int to Regexoptions is easy
 
G

GS

thank you. for your patience.

converting from checkboxes to int representation is the easy part for me.
however I still have trouble dealing with form int to checkboxes after
readying your answer.

I tried
RegexOptions myRegexOptions = (RegexOptions)regexOptions; // regexOptions;
is int form database
if ((RegexOptions.IgnoreCase) & myRegexOptions)
checkBoxIgnoreCase.Checked = true; // and I got
/*
Error 3 Cannot implicitly convert type
'System.Text.RegularExpressions.RegexOptions' to 'bool'
D:\data\IeI\gp\AppCom\IeStringClassProd\RegexParse2CSV\RegexParse2CSV\RegexP
arse2Csv.cs 421 17 RegexParse2CSV
*/

what did I misunderstand ?


Nicholas Paldino said:
Here is a link to the previous response:

http://groups.google.com/group/micr...ions+Nicholas+Paldino&rnum=2#66ad7715cf3c1832


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
Hello Nicholas, I was surprised that I could not find my prev post nor
answer to it. I was it must be a mistake of mine at late Saturday night.

I was searching to my prev post and did not find it: under from: gs. I
tried also by just subject of regexoption. Total posting by me since June
9
is 3 and only today's post is on regexoptions when I searched


Something went wrong with my newsreader and searches


please repeat your answer here if you don't mind



in
message news:%[email protected]...
What was wrong with my answer to your previous post?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I tried converting regexoptions to bits sp I can do bitwise operation
but I
just could not get it going. I tried Google, so far I failed to find the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from
database
stored as int and I am trying to represent that in check boxes. converting
int to Regexoptions is easy
 
N

Nicholas Paldino [.NET/C# MVP]

You didn't misunderstand anything, you just need one more step:

if (((RegexOptions.IgnoreCase) & myRegexOptions) == RegexOptions.IgnoreCase)
checkBoxIgnoreCase.Checked = true;

Or you could do:

if (((RegexOptions.IgnoreCase) & myRegexOptions) != 0)
checkBoxIgnoreCase.Checked = true;

Either way will work fine.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


GS said:
thank you. for your patience.

converting from checkboxes to int representation is the easy part for me.
however I still have trouble dealing with form int to checkboxes after
readying your answer.

I tried
RegexOptions myRegexOptions = (RegexOptions)regexOptions; // regexOptions;
is int form database
if ((RegexOptions.IgnoreCase) & myRegexOptions)
checkBoxIgnoreCase.Checked = true; // and I got
/*
Error 3 Cannot implicitly convert type
'System.Text.RegularExpressions.RegexOptions' to 'bool'
D:\data\IeI\gp\AppCom\IeStringClassProd\RegexParse2CSV\RegexParse2CSV\RegexP
arse2Csv.cs 421 17 RegexParse2CSV
*/

what did I misunderstand ?


in
message news:[email protected]...
Here is a link to the previous response:

http://groups.google.com/group/micr...ions+Nicholas+Paldino&rnum=2#66ad7715cf3c1832


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
Hello Nicholas, I was surprised that I could not find my prev post nor
answer to it. I was it must be a mistake of mine at late Saturday night.

I was searching to my prev post and did not find it: under from: gs. I
tried also by just subject of regexoption. Total posting by me since June
9
is 3 and only today's post is on regexoptions when I searched


Something went wrong with my newsreader and searches


please repeat your answer here if you don't mind



"Nicholas Paldino [.NET/C# MVP]" <[email protected]>
wrote
in
message What was wrong with my answer to your previous post?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I tried converting regexoptions to bits sp I can do bitwise operation
but
I
just could not get it going. I tried Google, so far I failed to
find
the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from
database
stored as int and I am trying to represent that in check boxes.
converting
int to Regexoptions is easy
 
G

GS

thank you very much for your patience and detailed answer.
much appreciated.
Nicholas Paldino said:
You didn't misunderstand anything, you just need one more step:

if (((RegexOptions.IgnoreCase) & myRegexOptions) == RegexOptions.IgnoreCase)
checkBoxIgnoreCase.Checked = true;

Or you could do:

if (((RegexOptions.IgnoreCase) & myRegexOptions) != 0)
checkBoxIgnoreCase.Checked = true;

Either way will work fine.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


GS said:
thank you. for your patience.

converting from checkboxes to int representation is the easy part for me.
however I still have trouble dealing with form int to checkboxes after
readying your answer.

I tried
RegexOptions myRegexOptions = (RegexOptions)regexOptions; // regexOptions;
is int form database
if ((RegexOptions.IgnoreCase) & myRegexOptions)
checkBoxIgnoreCase.Checked = true; // and I got
/*
Error 3 Cannot implicitly convert type
'System.Text.RegularExpressions.RegexOptions' to 'bool'
D:\data\IeI\gp\AppCom\IeStringClassProd\RegexParse2CSV\RegexParse2CSV\RegexP
arse2Csv.cs 421 17 RegexParse2CSV
*/

what did I misunderstand ?


in
message news:[email protected]...
Here is a link to the previous response:
http://groups.google.com/group/micr...ions+Nicholas+Paldino&rnum=2#66ad7715cf3c1832
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello Nicholas, I was surprised that I could not find my prev post nor
answer to it. I was it must be a mistake of mine at late Saturday night.

I was searching to my prev post and did not find it: under from: gs. I
tried also by just subject of regexoption. Total posting by me since June
9
is 3 and only today's post is on regexoptions when I searched


Something went wrong with my newsreader and searches


please repeat your answer here if you don't mind



"Nicholas Paldino [.NET/C# MVP]" <[email protected]>
wrote
in
message What was wrong with my answer to your previous post?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I tried converting regexoptions to bits sp I can do bitwise operation
but
I
just could not get it going. I tried Google, so far I failed to
find
the
answer.

any hint?

what is happening, is that I retrieved the regexoptions value from
database
stored as int and I am trying to represent that in check boxes.
converting
int to Regexoptions is easy
 

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

Top