Re: [ROOT] TTimer command semicolon weirdness

From: Valeri Fine (fine@bnl.gov)
Date: Wed Jun 06 2001 - 15:05:38 MEST


-----

> Hi,
>
>    The following code prints out an unwanted stream of "(unsigned char)0"
> to the console:

This is he general CINT interactive feature.
Try to print any C++ statement from the command line that is not followed by
"semicolon".
You should see CINT prints the statement "value" or zero of the value is of
"void".
The same is right when C++ statement is provided from any other source (when
CINT is called
indirectly, like your TTimer).

  To get the standard behavior one has to supply the standard syntax.

 Hope this helps
                                       Valeri

>
> {
>    char    *input;
>
>    TTimer  *timer = new TTimer("gSystem->ProcessEvents()", 250, kFALSE);
>    do {
>       timer->TurnOn();
>       timer->Reset();
>       input = Getline("Type <return> to exit: ");
>       timer->TurnOff();
>    } while (!input);
>
> }
>
>    With the addition of a semicolon to the end of the command string
> passed to the TTimer constructor, the code works as expected (waiting
> silently for input):
>
> {
>    char    *input;
>
>    TTimer  *timer = new TTimer("gSystem->ProcessEvents();", 250, kFALSE);
>    //                                                   ^
>    do {
>       timer->TurnOn();
>       timer->Reset();
>       input = Getline("Type <return> to exit: ");
>       timer->TurnOff();
>    } while (!input);
>
> }
>
>    Why? Is this what's supposed to happen?
>
>    I've been running this code under ROOT 3.01/02 14 May 2001 on Red Hat
> Linux 6.1 on an i386.
>    Thank you.
>
> David
>
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:48 MET