Hello Kemeoka-san,
I am happy to answer your question.
You can delete an already declared variable by using
G__deletevariable(const char* varname) API. For example,
root[0] int a
root[1] G__deletevariable("a")
root[2] double a
This works most of the time. However, please be careful
and don't go too far. If you use this API many times in a
process, problems may occur. Please stay simple.
Thank you
Masa Goto
----- Original Message -----
From: "Satoru KAMEOKA" <kameoka@lambda.phys.tohoku.ac.jp>
To: <roottalk@pcroot.cern.ch>
Sent: Sunday, May 04, 2003 5:55 PM
Subject: [ROOT] How to disable a variable
> Hi all,
>
> Is there any way to disable a once declared variable without
> gROOT->Reset in interactive session?
> gROOT->Reset deletes all the variables and not always desirable.
> Typical case is that a variable is declared with wrong type by mistake
> as follows:
>
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 3.04/02 11 January 2003 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> FreeType Engine v1.x used to render TrueType fonts.
> Compiled for linux with thread support.
>
> CINT/ROOT C/C++ Interpreter version 5.15.68, Dec 12 2002
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] int a
> root [1] double a
> Error: a already declared as different type FILE:/tmp/kkhYoc_cint LINE:1
> *** Interpreter error recovered ***
> root [2]
>
> Best regards,
> S.Kameoka
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET