TMinuit help system

From: Alexander Zvyagin (zvyagin@mx.ihep.su)
Date: Sun Oct 25 1998 - 10:27:20 MET


                                           IHEP, Protvino, Russia, 25-OCT-1998

    Dear ROOTers and ROOT developers!

It seems that TMinuit help system is difficalt in usage. (I faild to get help
about MIGRAD Minuit command via function TMinuit::mnhelp). Some very simple
requests are wrong:
gMinuit->mnhelp();
gMinuit->mnhelp("");
gMinuit->mnhelp("?");
gMinuit->mnhelp("help");
gMinuit->mnhelp("HELP");
gMinuit->mnhelp("MIGRAD");
.....

Below I propose some improvements in mnhelp function (I think so...). Current
code is marked
"OLD:" at the beginning of line.

1. 
   class TMinuit : public TNamed {
   ...
OLD:    void mnhelp(TString comd);
NEW:
        void mnhelp(TString comd="");      // Set default value

2.
void TMinuit::mnhelp(TString comd)
{
.....
//*-*.......................................................................
//*-*
//*-*  Global HELP: Summary of all commands
//*-*  ====================================
//*-*
OLD: if (comd == '*')
NEW:
     comd.ToUpper();  // convert all symbols to uppercase

     if( comd=='*' || comd=='?' || comd=="" || comd=="HELP" )
     {
       Printf(.....);
       ...
       Printf(.....);
     }

    if( !strncmp(comd.Data(),"CLE",3) ) {
    ....
    }
    
    if( !strncmp(comd.Data(),"MINI",4) ) {
    ...
    }

And so on for all commands (comparision only first several symbols).
The implemination is simple and greatly improve help system of TMinuit.


May be it will be better to introduce function

TString::CompareNTo(char* cs, int N, TString::ECaseCompare cmp = kExact)

for comparing only first N symbols.

With best wishes,
Alexander.



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:39 MET