+ Collaboration diagram for Console:

Functions

void post (C74_CONST char *fmt,...)
 Print text to the Max window. More...
 
void cpost (C74_CONST char *fmt,...)
 Print text to the system console. More...
 
void error (C74_CONST char *fmt,...)
 Print an error to the Max window. More...
 
void ouchstring (C74_CONST char *s,...)
 Put up an error or advisory alert box on the screen. More...
 
void postatom (t_atom *ap)
 Print multiple items in the same line of text in the Max window. More...
 
void object_post (t_object *x, C74_CONST char *s,...)
 Print text to the Max window, linked to an instance of your object. More...
 
void object_error (t_object *x, C74_CONST char *s,...)
 Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background). More...
 
void object_warn (t_object *x, C74_CONST char *s,...)
 Print text to the Max window, linked to an instance of your object, and flagged as a warning (highlighted with a yellow background). More...
 
void object_error_obtrusive (t_object *x, C74_CONST char *s,...)
 Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background), and grab the user's attention by displaying a banner in the patcher window. More...
 

Detailed Description

Function Documentation

void cpost ( C74_CONST char *  fmt,
  ... 
)

Print text to the system console.

On the Mac this post will be visible by launching Console.app in the /Applications/Utilities folder. On Windows this post will be visible by launching the dbgView.exe program, which is a free download as a part of Microsoft's SysInternals.

Parameters
fmtA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
Remarks
Particularly on MacOS 10.5, posting to Console.app can be a computationally expensive operation. Use with care.
See also
post()
object_post()
void error ( C74_CONST char *  fmt,
  ... 
)

Print an error to the Max window.

Max 5 introduced object_error(), which provides several enhancements to error() where a valid t_object pointer is available.

error() is very similar to post(), thought it offers two additional features:

  • the post to the Max window is highlighted (with a red background).
  • the post can be trapped with the error object in a patcher.
Parameters
fmtA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
See also
object_post()
post()
cpost()

Referenced by jit_gl_begincapture(), and jit_gl_report_error().

void object_error ( t_object x,
C74_CONST char *  s,
  ... 
)

Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background).

Max window rows which are generated using object_post() or object_error() can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post() and object_error() will also automatically provide the name of the object's class in the correct column in the Max window.

Parameters
xA pointer to your object.
sA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
See also
object_post()
object_warn()
void object_error_obtrusive ( t_object x,
C74_CONST char *  s,
  ... 
)

Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background), and grab the user's attention by displaying a banner in the patcher window.

This function should be used exceedingly sparingly, with preference given to object_error() when a problem occurs.

Parameters
xA pointer to your object.
sA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
See also
object_post()
object_error()
void object_post ( t_object x,
C74_CONST char *  s,
  ... 
)

Print text to the Max window, linked to an instance of your object.

Max window rows which are generated using object_post() or object_error() can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post() and object_error() will also automatically provide the name of the object's class in the correct column in the Max window.

Parameters
xA pointer to your object.
sA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
Remarks
Example:
1 void myMethod(myObject *x, long someArgument)
2 {
3  object_post((t_object*)x, "This is my argument: %ld", someArgument);
4 }
See also
object_error()
void object_warn ( t_object x,
C74_CONST char *  s,
  ... 
)

Print text to the Max window, linked to an instance of your object, and flagged as a warning (highlighted with a yellow background).

Max window rows which are generated using object_post(), object_error(), or object_warn can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post(), object_error(), or object_warn() will also automatically provide the name of the object's class in the correct column in the Max window.

Parameters
xA pointer to your object.
sA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
See also
object_post()
object_error()
void ouchstring ( C74_CONST char *  s,
  ... 
)

Put up an error or advisory alert box on the screen.

Don't use this function. Instead use error(), object_error(), or object_error_obtrusive().

This function performs an sprintf() on fmtstring and items, then puts up an alert box. ouchstring() will queue the message to a lower priority level if it's called in an interrupt and there is no alert box request already pending.

Parameters
sA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
See also
error()
object_error()
object_error_obtrusive()
void post ( C74_CONST char *  fmt,
  ... 
)

Print text to the Max window.

Max 5 introduced object_post(), which provides several enhancements to post() where a valid t_object pointer is available.

post() is a printf() for the Max window. It even works from non-main threads, queuing up multiple lines of text to be printed when the main thread processing resumes. post() can be quite useful in debugging your external object.

Parameters
fmtA C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments.
...Arguments of any type that correspond to the format codes in fmtString.
Remarks
Note that post only passes 16 bytes of arguments to sprintf, so if you want additional formatted items on a single line, use postatom().

Example:

1 short whatIsIt;
2 
3 whatIsIt = 999;
4 post ("the variable is %ld",(long)whatIsIt);
Remarks
The Max Window output when this code is executed.
1 the variable is 999
See also
object_post()
error()
cpost()

Referenced by jit_gl_report_error().

void postatom ( t_atom ap)

Print multiple items in the same line of text in the Max window.

This function prints a single t_atom on a line in the Max window without a carriage return afterwards, as post() does. Each t_atom printed is followed by a space character.

Parameters
apThe address of a t_atom to print.
See also
object_post()
post()
cpost()
  Copyright © 2015, Cycling '74