Watching


Watching

Once the program has stopped in a breakpoint, it is possible to watch the values that the program variables. To do this, just place the mouse cursor over the variable in the code editor; an information tooltip will be displayed momentarily showing the value of the variable (see figure below).
Una vez que el programa se ha detenido en un punto de paro, es posible inspeccionar el valor de las variables del programa. Para hacer esto, solo coloque el cursor del ratón sobre la variable en el editor de código; un mensaje informativo aparecerá momentáneamente mostrando el valor de la variable (vea la figura de abajo).

WatchTooltip

Tip
Once the debug has started, a window at the bottom of Microsoft Visual Studio will be displayed showing the values of the local variables. Inside this window there is a tab called this that displays the current object information if Object Oriented Programming is used (all Wintempla projects use object oriented programming). The figure below shows the debug window.
Una vez que la depuración ha comenzado, una ventana en la parte inferior del Microsoft Visual Studio aparecerá mostrando los valores de las variables locales. Dentro de esta ventana hay una pestaña llamada this que muestra la información del objeto corriente si la se está usando la Programación Orientada a Objetos (todos los proyectos de Wintempla usan la programación orientada a objetos). La figura de abajo muestra la ventana de depuración

LocalsAutos

Watch

It is possible to insert a custom watch, to do this, open the Watch1 window and type the name of the variable that you would like to watch. If you do no find the Watch1 button, you may customize Microsoft Visual Studio to display the Watch1 button or any missing command button (Tools>Customize>Commands).
Es posible insertar un inspeccionador personalizado, para hacer esto, abra la ventana Watch1 y escriba el nombre de la variable que se desea inspeccionar. Si no se puede encontrar el botón de Watch1, usted puede personalizar Microsoft Visual Studio para mostrar el botón de Watch1 u otro botón de cualquier comando que falte (Tools>Customize>Commands).

Watch1

Microsoft Visual Studio Debug Output

The Debug Output can be used to print some text at the output window of Microsoft Visual Studio. This can be very useful for debugging purposes. To write to the output you must call OutputDebugString(L"Hello") from any part of your code. Wintempla provides the function Sys::PrintLine() that accepts the percent commands like other printing functions. The example below illustrates how to use it; the function will print the name of the function and line number. In the code below %d will be replaced with the random number generated by rand(). In a real life application, you may print any variable of interest. __LINE__ and __FUNCTIONW__ are pre-defined pre-processor macros.
La Salida de Depuración puede ser usada para imprimir texto en la ventana de salida de Microsoft Visual Studio. Esto puede ser muy útil para propósitos de depuración. Para escribir en la salida usted debe llamar OutputDebugString(L"Hello") desde cualquier parte de su código. Wintempla proporciona la función Sys::PrintLine() que acepta los comandos de porcentaje de forma similar a otras funciones de impresión. El ejemplo de abajo ilustra cómo usarlo; la función imprimirá el nombre de la función y número de línea. En el código de abajo %d será reemplazado con el número aleatorio generado por rand(). En una aplicación de la vida real, usted puede imprimir cualquier variable que le interese. __LINE__ and __FUNCTIONW__ son macros del pre-procesador que ya están definidos.

Program.cpp

void Program::Window_Open(Win::Event& e)
{
#ifdef _DEBUG
     Sys::PrintLine(__LINE__, __FUNCTIONW__, L"some diagnostic text %d %f", rand(), 0.5);
#endif
}


Tip
If the Output Window is close, click on the VIEW menu and select Output.
Si la Output Window está cerrada, haz clic en el menú de VIEW y selecciona Output.

© Copyright 2000-2021 Wintempla selo. All Rights Reserved. Jul 22 2021. Home