Re: LINQ and XML for compact framework



On May 1, 1:27 pm, Wan <luo...@xxxxxxxxx> wrote:
Ok, I am not sure if you complie it from command line will help to see
the problem.

It would if you would tell us how the program behaved differently to
how you expected - without referring to the debugger.

As the program was complied with no errors.

Yes, many short but complete programs do.

I expect this piece of code can go to the XML I pasted, and find the
element as well as changing the value. However, it didn't changed
value. even though it found the XML file, loaded XML, ran the LINQ
statement. Finally when I check the value of "IEnumerable<XElement>
msgs" by watching this variable. It will give me such error message:

Yes, so you've said. That's in the debugger. Now, can you show a
program which produces output X when you expect output Y, without
having to break and look at the debugger? If it's *only* an issue with
the debugger, I'm unlikely to be able to help. If the program isn't
working as expected however, then please specify in what way that is
the case.

Here's an example of what I mean:

<sample post>
Problem: Addition with large numbers appears not to work.

I'm having trouble with addition when it comes to large integers

Program:
using System;

class Test
{
static void Main()
{
int i = 2147483647;
Console.WriteLine("i={0}", i);
Console.WriteLine("i+1={0}", i+1);
}
}

Expected output:
i=2147483647
i+1=2147483648

Actual output:
i=2147483647
i+1=-2147483648

Note that the result is negative. Why?
</sample post>

At this point:
a) I can easily compile and run the code
b) I can understand the problem
c I can verify that I see the problem too
d) I can easily change the code to try to fix it

Now obviously that's a trivial example - but it's a good model. While
you can only express what's wrong in terms of watching a variable in
the debugger, I'm inclined to put the issue down to a debugger
problem.

Jon
.



Relevant Pages

  • Re: Good debugger?
    ... Stepping through a script sequence, one line at a time, and watching ... the variables change values as you do so is a much better approach to ... learning a language, in my opinion, then inputing values to a function ... think I've ever seen a debugger do that before). ...
    (comp.lang.tcl)
  • Re: Reading one record from an Access DB
    ... Here is the string for the SQL statement take while watching in the ...
    (microsoft.public.dotnet.languages.vb)
  • Can I put a "Watch" on a variable while debugging?
    ... I would like to run the debugger with no breakpoints and have it ... automatically break if a particular variable I am watching is modified. ...
    (microsoft.public.dotnet.general)