Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -1530,10 +1530,14 @@ === Substitution codes === %c Display a single character whose code is the low 8-bits of the value. +%C + The low 3-bits of the argument specifies the colour of the text. If it + is not a number, then the colour is unchanged. + %d Display a signed decimal number. %i Display a picture. Consumes two arguments, being first a class and then Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -1186,10 +1186,15 @@ if(v.t==TY_NUMBER) { sqlite3_str_appendchar(s,1,31); sqlite3_str_appendchar(s,1,v.u&255?:255); } break; + case 'C': + if(argi==argc) break; + v=vstack[vstackptr+argi++]; + if(v.t==TY_NUMBER) sqlite3_str_appendchar(s,1,(v.u&7)+1); + break; case 'd': if(argi==argc) break; v=vstack[vstackptr+argi++]; if(v.t==TY_NUMBER) sqlite3_str_appendf(s,"%d",(signed int)v.s); break; @@ -1213,10 +1218,13 @@ sqlite3_str_appendf(s,"%llu",(sqlite3_int64)v.u); break; case TY_CLASS: sqlite3_str_appendf(s,"%s",classes[v.u]->name); break; + case TY_MESSAGE: + sqlite3_str_appendf(s,"%s",v.u<256?standard_message_names[v.u]:messages[v.u-256]); + break; default: Throw("Type mismatch"); } break; case 'u': @@ -1254,10 +1262,13 @@ quiz_text=sqlite3_mprintf("%llu",(sqlite3_int64)v.u); break; case TY_CLASS: quiz_text=sqlite3_mprintf("%s",classes[v.u]->name); break; + case TY_MESSAGE: + quiz_text=sqlite3_mprintf("%s",v.u<256?standard_message_names[v.u]:messages[v.u-256]); + break; default: Throw("Type mismatch"); } } if(!quiz_text) fatal("Allocation failed\n");