Page 1 of 1

NXC: ... display print output problem

Posted: 04 Jan 2011, 21:20
by HaWe
hi,
I just came upon this issue:
this code works:

Code: Select all

for (int z=0;z<8;z++) {
  NumOut(0,56-(z*8), (z&4)?1:0);
}
but this not:

Code: Select all

for (int z=0;z<8;z++) {
  TextOut(0,56-(z*8), (z&4)?"TRUE":"FALSE");
}
why not?

Re: NXC: ... display print output problem

Posted: 06 Jan 2011, 03:33
by muntoo
I suspect it's because it expects a string/variable. Not a bracket.

Re: NXC: ... display print output problem

Posted: 06 Jan 2011, 18:02
by afanofosc
The way that I implemented this function in the compiler makes it not work for ?: expressions. What happens if you try using ?': when passing a string into a user defined function? I think ?: may not be fully is not supported for string expressions.

John Hansen