Rik's Treehouse
>
Babbling in Binary
>
My Software
>
Orphanware
>
R2DToo
>
R2DToo Help
>
For the Programmer
> dprintf
dprintf
Declaration
Parameters
Return Value
Remarks
Revisions
Example
Declaration
int __stdcall dprintf( const char *format, // format specifier ... // argument );
Parameters
format
Format string like the standard C printf() function.
...
Arguments to the format string.
Return Value
Returns the number of bytes written (neglecting the trailing newline character).
Remarks
This function is available through the API. It provides the model programmer with some primitive debugging functionality by displaying the argument of the function in a debug window and dumping the same to a debug file (always
OutDbg1.txt
in the current folder). The programmer can use this to display state variables and parameters as the simulation is being executed. The format of the parameters is identical to the standard C function
printf()
. See the documentation on
printf()
for more information.
dprintf()
differs in that it always appends a trailing newline character (
) to every call to
dprintf()
to enhance readability of the debug window.
Revisions
v1.2
new!
Example
void __stdcall
onTick
(
pParam
param, double &time) { // print 10 parameters to debug window and OutDbg1.txt for (int i=0; i<10; i++) { dprintf("Parameter[%i] = %g",i,(float)param[i]); } }
[Rik's Office Hours]
[Contact Rik]
Last updated: Fri Apr 30 2004, 1:36pm