[go: up one dir, main page]

Menu

[897c37]: / mlib / lib / printf.lpc  Maximize  Restore  History

Download this file

31 lines (24 with data), 353 Bytes

/*
 * A printf object.
 * mmcg, Jun 27, 1992
 */

reset() {
	return 0;
	}

/*
 * fmt is a c-style format string.
 * args is an array of arguments.
 */

printf(fmt, args) {
    string o;
    string s;
    int x;

    o = "";
    x = 0;
    
    do {
	y = index(fmt, '%', x);
	if (y < 0) {
	    o = o + fmt[x..];
	    }
	else {
	    o = o + fmt[x..y-1];