On Mon, Feb 27, 2012, at 22:30, IOhannes m zmölnig wrote:
> On 02/27/12 19:34, Hans-Christoph Steiner wrote:
> >
> > If post(), error(), etc. are your examples, then verbose() should have no
> > level argument, just the fmt, then it could post at level 4. That makes
> > sense to me. If verbose() is meant to post messages at varying levels, then
> > it should use the same numbering scheme as everything else, i.e.
> >
>
> it's the other way round.
> if you insist on that, then logpost() should have the same numbering
> scheme as everything else:
> logpost(0)==post()
> logpost(1)==verbose(1)
> logpost(-1)==error()
I don't think a numbering range from -2 to 2 makes much sense, like you
suggest here. Programmers start counting from 0, not -2. You might
want to double-check the code if you are wondering how everything else
works:
src/s_print.c
static void dopost(const char *s)
{
...
sys_vgui("::pdwindow::post {%s}\n", strnescape(upbuf, s,
MAXPDSTRING));
tcl/pdwindow.tcl
proc ::pdwindow::post {message} {logpost {} 2 $message}
proc ::pdwindow::verbose {level message} {
incr level 4
logpost {} $level $message
The numbers on the Pd window are 0 - 4 and the verbose proc uses "incr
level 4" to add 4 to the level before posting, thereby making its own
level numbering scheme that is off by four from the rest.
.hc
_______________________________________________
Pd-dev mailing list
[email protected]
http://lists.puredata.info/listinfo/pd-dev