Hi Chris, > [debuggin' blues - keypress/keydown and step-through] > Anyway around this? Is there a way I can BREAK and > then execute the code I want immediately?
What code do you want to execute? Is it a sub or function unreliant on form state, which you are trying to use to encapsulate your logic (preferred)? Or is it just a certain section of something within another procedure on a form? For the first, you're best off using the "debug window" (CTRL+G) then typing a calling method - for example, to see the current date you could use: "?date" Encapsulation makes this possible, and it also makes your code more portable (into the next project you've got 8 hours to write). These procedures should be written as functions, take named parameters that make logical sense and return a typed variable or array, based on the need of the caller. Almost every sample I post within the groups or on my site uses these methods. Check 'em out. For the second option (eeewwwww), you're best off setting a breakpoint. That is, find the line of code you don't trust, and click on it in code view. Press F9. This will set a breakpoint on THAT LINE. When you run the program (F5) your program will immediately stop at that line so you can float over variables and see their values, or use the debug window to check state (for example, you want to make sure a MOD call is accurate, so you test the MOD from the debug window a dozen times to make sure you're pulling the correct value for the code). You can then immediately edit *certain* lines of code, but not everything. Then general rule is that if the code is declaring an object as type then editing it will stop execution completely. The same happens if the 'line' you edit is wrapping to two or more lines, or if you are trying to change named anchors or whatever. These will invariably cause you heartache within debugging, so move as much of the logic reliant on those into separate procedures as you can. Well, aside from error trapping, of course. Regards, Shawn K. Hall http://12PointDesign.com/ http://ReliableAnswers.com/ '// ======================================================== He's so dense, light bends around him. '// ======================================================= Rules : http://ReliableAnswers.com/List/Rules.asp Home : http://groups.yahoo.com/group/vbHelp/ ======================================================= Post : [email protected] Join : [EMAIL PROTECTED] Leave : [EMAIL PROTECTED] '// ======================================================= Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/vbhelp/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
