Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thread is at a location at which function evaluation is not possible

Status
Not open for further replies.

cfprg

Programmer
Apr 14, 2004
38
US
Regex regEx = new Regex(xmlZone.InnerText, (RegexOptions.Multiline | RegexOptions.IgnoreCase));
matches = regEx.Matches(bldrZone.ToString()); foreach (Match match in matches) {
//code
}


The strings "xmlZone.InnerText" and "bldrZone.ToString()" are available until i try to match "bldrZone.ToString()" with regular expression "xmlZone.InnerText".

"bldrZone.ToString()" becomes unavailable, when i try to use this "matches = regEx.Matches(bldrZone.ToString());"

The error i get is "evaluation of function 'bldrZone.ToString()' cannot take place because the thread is at a location at which function evaluation is not possible".

 
Try calling bldrZone.ToString() first, and passing the result via a string variable to the Matches() method.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 

Thanks chiph, i figured it out. The problem was in regex itself as thread parsing it was going into infinite loop, i changed my regex and it works fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top