Gente,
tengo una definici贸n de comando que uso hace bastante tiempo, que te pasa no solo el valor sino tambien la lineas de la funcion donde se invoca, y la expresion evaluada. Al ser un comando, se puede hacer una definici贸n nula cuando se compila la version final.
#ifdef __RELEASE__
# xtranslate DEBUG <clauses, ...> =>
#else
#translate ASSTRING( <x> ) => If( <x> == NIL, 'NIL', Transform( <x> , NIL ) ) + CRLF
#xcommand DEBUG <cString1>[, <cStringN>] ;
=> ;
OutputDebugString( ProcName() +"("+LTrim(Str(ProcLine())) +") - " ) ; OutputDebugString( <"cString1">+" ("+ValType( <cString1> )+"): " ) ; OutputDebugString( ASSTRING( <cString1> ) ) ;
[ ; OutputDebugString( ProcName() +"("+LTrim(Str(ProcLine())) +") - " ) ; OutputDebugString( <"cStringN">+" ("+ValType( <cStringN> )+"): " ) ; OutputDebugString( ASSTRING( <cStringN> ) ) ]
#endif
Es interesante tambien el uso de transform para hacer string casi cualquier cosa, pero no es el tema a tratar
Por ejemplo, si ponemos en la l铆nea 895 de bitmap.prg la sig. l铆nea,
DEBUG ::lScroll, nVisHeight, nVisWidth, ::hBitmap, ::oVScroll
Un ejemplo de lo que obtendremos en dBWin32 podr铆a ser:
TBITMAP:SCROLLADJUST(895) - ::lScroll (L): F
TBITMAP:SCROLLADJUST(895) - nVisHeight (N): 329
TBITMAP:SCROLLADJUST(895) - nVisWidth (N): 450
TBITMAP:SCROLLADJUST(895) - ::hBitmap (N): -1509616760
TBITMAP:SCROLLADJUST(895) - ::oVScroll (U): NIL
TBITMAP:SCROLLADJUST(895) - ::lScroll (L): F
TBITMAP:SCROLLADJUST(895) - nVisHeight (N): 656
TBITMAP:SCROLLADJUST(895) - nVisWidth (N): 1024
TBITMAP:SCROLLADJUST(895) - ::hBitmap (N): -536539779
TBITMAP:SCROLLADJUST(895) - ::oVScroll (U): NIL
Esto nos ayuda a saber Exactamente que estamos viendo, porque si imprimimos solo el valor en outdebug no sabremos exactamente a que variable o campo corresponde, ni a que punto del programa corresponde si tenemos muchos valores.
Y todo esto se quita con a帽adir un /D__RELEASE__ en la l铆nea de compilaci贸n de los prgs!
Espero que les sea tan 煤til como a m铆,
Carlos.