Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 8th, 2012, 10:55 PM
Authorized User
Points: 130, Level: 2
Points: 130, Level: 2 Points: 130, Level: 2 Points: 130, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Location: Australia
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Default Debugging - Immediate Window

I am working through Lesson 12 (Debugging Code) and have an issue with the Immediate Window.

I have loaded the Tax Calculator solution and opened the Immediate Window.

When i type in subtotal as the book says, i get "The name 'subtotal' does not exist in the current context". I also tried with a question mark in front.

I thought maybe its because it wasnt running, but it cant be used when running the program.

I also (as suggested) typed sub and pressed CTRL+SPACE and did not get the intellisense help.

Why wont it work. I can see this might be very handy for debugging.

Code:
?subtotal
The name 'subtotal' does not exist in the current context

subtotal
The name 'subtotal' does not exist in the current context
__________________
"These pretzels are making me thirsty"
  #2 (permalink)  
Old November 8th, 2012, 11:54 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

The program does need to be running but it needs to be in break mode so you've interrupted execution. You also need to interrupt execution in a place where subtotal is defined.

Try setting a breakpoint on the line that declares subtotal and then click the Calculate button. That should get you in the debugger where you can do this.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #3 (permalink)  
Old November 9th, 2012, 02:54 AM
Authorized User
Points: 130, Level: 2
Points: 130, Level: 2 Points: 130, Level: 2 Points: 130, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Location: Australia
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Ok, thanks. Working now. I didnt have a break
__________________
"These pretzels are making me thirsty"
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can any1 solve window.open() and window.opener issues abhihello123 BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 1 April 1st, 2010 10:30 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM



All times are GMT -4. The time now is 03:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.