Results 1 to 6 of 6

Thread: debug watching

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    debug watching

    Is there (there has to be!) a way to print to the immediate window like VB's debug.print statement?

    Also, in VB you could breakpoint then type (in the immediate window) a function and it would print the function's output, like now(). In C# it will print properties, but won't execute functions. Why?

    IE
    >? string.length
    10
    >? string.ToStrin()
    error
    balls deep in bad code

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: debug watching

    System.diagnostics.debug.writeline

    it should print out hte values. HOWEVER if you reference some function without the () it will just spit out the function name, (ie, do .ToString() not ToString )
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Re: debug watching

    doesn't Console.Writeline() do the same?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: debug watching

    The Immediate window has two modes: immediate and command (I think). I used to know how to switch between the two but I haven't used it in so long I can't remember. I'm sure a quick help search would turn up something. I know it's very simple, like entering a few characters. I believe the second mode would allow you to execute functions. Also, you can use the Watch window to evaluate pretty much anything that is valid for the current context.

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: debug watching

    Quote Originally Posted by Andy
    doesn't Console.Writeline() do the same?
    umm Console is supposed to write on the console window (like if you have a Console project then you should use that). and Debug is supposed to control the debugger window, I think
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Re: debug watching

    yeah, that makes sense..in VB, i always use Console.Writeline for debugging...maybe i should reconsider my tactics

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width