Code: Select all
#define printfxy( _x, _y, _fmt, _val) { \
string sval = FormatNum(_fmt, _val); \
TextOut(_x, _y, sval); \
}
//********************************************************************
task main()
{
printf ("%s", "line 1 printf");
printfxy(0,48, "%s", "line 2 printfxy");
printfxy(0,40, "line 3 num :%3d", 33);
while (1);
}
edit:
as expected, when using _fmt="%s" with
sprintf(sval, _fmt, _val);
instead of
sval = FormatNum(_fmt, _val);
it doesn't work neither!