A group blog from members of the VB team
Running Code at Design Time from the Immediate Window
Back in Visual Basic 6.0, developers were able to evaluate expressions from the Immediate Window at design time (we’ll call this feature ‘DTEE’ – Design Time Express Evaluation from now on). This feature gave the developer an opportunity to test their code out and to debug their functions without having to run their entire application first and it was a handy development feature which was not available in Visual Basic 2002 and 2003.
Visual Basic 2005 has brought this feature back to the VB Developer and here is a quick blurb on what you can do with DTEE.
Note: DTEE is available for all of the Visual Basic Windows project types. If DTEE is not available for the project type you have opened in the IDE, you will get the following message in the Immediate Window when you try and evaluate an expression: “The expression cannot be evaluated while in design mode.”
Let’s try it out!
Return num1 * num1
Function Fib(ByVal n As Long) As Long
If n <= 1 Then
Fib = n
Fib = Fib(n - 1) + Fib(n - 2)
x = New Class1
Try it out and let us know what you think of DTEE in Visual Basic 2005!
PaulYuk and I just returned from the EMEA tour where we demoed tons of new VB 2005 features to groups