#18 TextOut and NumOut issues

compiler
closed-rejected
John Hansen
NXC (53)
5
2007-06-19
2007-06-18
Anonymous
No

I am getting strange behavior from the TextOut and NumOut commands.

I just have an infinite loop running to print out the raw reading from the sensors for my own edification.

Based on the manual and the tutorial, the printing lines originally looked like:

ClearScreen();
TextOut(0, LCD_LINE1, "Touch:");
NumOut(60, LCD_LINE1, touchVal);
Wait(500);

This gave me the error:
line 25: Error: ',' expected
line 25: Error: Unknown data type
line 25: Error: string constant or variable of type string expected
line 26: Error: ')' expected

If I comment out the TextOut line, I get a similar set of errors for NumOut.

With a little playing around, I found that this code compiles:

ClearScreen();
TextOut(0, LCD_LINE1, "Touch:", "Touch:");
NumOut(60, LCD_LINE1, touchVal, touchVal);
Wait(500);

But when I run this, all I see is the result from the NumOut. I put a Wait(500) in between the TextOut and NumOut, and I can watch the two flash back and forth, but apparently the NumOut is overwriting the TextOut.

I am at a loss to figure out what is going on.

Thanks for any help.

Discussion

  • Logged In: NO

    Belay that request.

    I went into the NXCDefs.h file and saw that the order of arguments for NumOut and TextOut have changed. It apparently is no longer optional to include the clear screen option since it is the third value.

    My program works when the lines are:
    TextOut(0, LCD_LINE1, FALSE, "Touch:");
    NumOut(60, LCD_LINE1, FALSE, touchVal);

     
  • John Hansen
    John Hansen
    2007-06-18

    • milestone: --> compiler
    • status: open --> open-rejected
     
  • John Hansen
    John Hansen
    2007-06-18

    Logged In: YES
    user_id=661666
    Originator: NO

    The NXCDefs.h header file does not have TextOut and NumOut macros in it. These API functions for NXC are implemented directly in the compiler itself. Read the release notes and NXC Guide documentation (as well as the latest tutorial) for information that reflects the latest version of the NBC/NXC compiler.

    As of Beta 30 (the latest version) TextOut and NumOut in NXC take 3 or 4 arguments. The 4th argument is an optional boolean value indicating whether you should clear the screen or not. Also as of Beta 30 you do not need to #include "NXCDefs.h" since the compiler has that header built-in now (see the history.txt file).

    If your program compiles and works with the clear screen boolean as the 3rd parameter then you are using a very old version of the compiler. Please upgrade to b30 or use the internal compiler built into the latest test release of BricxCC.

     
  • John Hansen
    John Hansen
    2007-06-18

    • status: open-rejected --> closed-rejected
     
    • status: closed-rejected --> open-rejected
     
  • Logged In: NO

    I thought I had the latest version of Bricxcc. (Just downloaded it last week). I will check that.

     
  • Logged In: NO

    I confirmed my version of Bricx Command Center is 3.3.7.16

    That is the latest non-test version available from SourceForge.net

     
  • Logged In: NO

    Whoops. I need to read more carefully. I will download the latest test release.

     
  • John Hansen
    John Hansen
    2007-06-19

    Logged In: YES
    user_id=661666
    Originator: NO

    Please just email me (bricxcc@comcast.net) for these sorts of questions/problems.

    The latest test release is at http://bricxcc.sourceforge.net/test_release.zip.

    Regardless of the version of BricxCC, though, if you have the latest NBC beta release (b30) and you aren't using the internal compiler (which is not available in 3.3.7.16) then you should get the correct TextOut and NumOut behavior as described in the latest NXC Guide, NXC Tutorial, and the release notes (history.txt) which are included in the b30 zip. If you have b30 of NBC you should delete any copies of the 3 header files (NBCCommon.h, NXTDefs.h, and NXCDefs.h) on your computer so that you don't get confused by older versions lying around. The compiler will ignore these old copies but you may get confused by looking at the old contents that do not match the versions built into the compiler.

     
  • John Hansen
    John Hansen
    2007-06-19

    • status: open-rejected --> closed-rejected