Re: [ROOT] TTimer command semicolon weirdness

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Jun 06 2001 - 12:09:56 MEST


Hi David,

  yes this is what is supposed to happen. The string "gSystem->ProcessEvents()"
is passed to CINT and when not trailed by a semicolon CINT prints the return
value of the method executed. So just add the ;. Just like on the command line.

Cheers, Fons.


David Faden wrote:
> 
> Hi,
> 
>    The following code prints out an unwanted stream of "(unsigned char)0"
> to the console:
> 
> {
>    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

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



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