Changeset 96b1982 in tol


Ignore:
Timestamp:
Dec 11, 2010, 7:25:50 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7519264
Parents:
bb16420
Message:

Refs #1029
Adding Text to Cint.import_tol_var

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2788 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/contrib/cint/tolCint.cpp

    rbb16420 r96b1982  
    6565  int G__init_cint_ = G__init_cint("cint");
    6666  G__set_errmsgcallback(Cint_errmsgcallback);
     67  G__setautoconsole(1);
    6768  return(G__init_cint_);
    68 };
     69}
    6970
    7071//--------------------------------------------------------------------
    … …  
    179180}
    180181
    181 //--------------------------------------------------------------------
    182   DeclareContensClass(BDat, BDatTemporary, BDatCINT_import_tol_var);
    183   DefExtOpr(1, BDatCINT_import_tol_var,
    184   "Cint.import_tol_var", 1, 0, "Anything Anything",
     182
     183
     184//--------------------------------------------------------------------
     185  DeclareContensClass(BDat, BDatTemporary, BDatCINT_import_from_tol);
     186  DefExtOpr(1, BDatCINT_import_from_tol,
     187  "Cint.import_from_tol", 1, 0, "Anything Anything",
    185188  "(Anything var1 [, Anything var2, ...])",
    186189  I2("Imports TOL variables, global or local, into CINT global scope.\n"
    187190     "Returns the number of imported variables\n"
    188191     "TOL variables must have a valid name in TOL and C languages.\n"
    189      "At this moment these are the available TOL types :\n"
    190      "  TOL       CINT\n"
    191      "  Real      double\n"
    192      "  Matrix    class Matrix\n"
    193      "  Text      class Text\n"
    194      "You can view the declaration of corresponding C/C++ types at ",   
     192     "At this moment these are the available TOL types :\n",   
    195193     "Importa variables TOL, globales o locales, al ámbito global de CINT\n"
    196194     "Devuelve el número total de variables correctamen te importadas.\n"
    197195     "Las variables TOL deben tener un nombre válido en los lenguajes "
    198196     "TOL y C\n"
    199      "Los tipos TOL admitidos para la importación son los siguientes:\n"
     197     "Los tipos TOL admitidos para la importación son los siguientes:\n")+
    200198     "  TOL       CINT\n"
    201199     "  Real      double\n"
    202200     "  Matrix    class Matrix\n"
    203      "  Text      class Text\n"
     201     "  Text      class Text\n"+
     202  I2("You can view the declaration of corresponding C/C++ types at ",   
    204203     "Puede ver la declaración de los correspondientes tipos C/C++ en ")+
    205204     "\nhttps://www.tol-project.org/browser/tolp/trunk/tol/"
    206205     "stdlib/general/TolCint/tol_cint_casting.cpp"+
    207      cint_url_link,
    208      BOperClassify::Conversion_);
    209   void BDatCINT_import_tol_var::CalcContens()
    210 //--------------------------------------------------------------------
    211 {
    212   if(CheckNonDeclarativeAction("Cint.import_tol_var")) { return; }
     206  I2("Imported variables can be modified by CINT routines but memory "
     207     "allocation and the internal structure cannot be altered. "
     208     "For example, you can change the elements of a Matrix but cannot "
     209     "change the number of cells, rows nor columns.",
     210     "Las variables importadas pueden ser modificadas por rutinas CINT "
     211     "pero el alojo de memoria no puede ser alterado. "
     212     "Por ejemplo, es posible cambiar los elementos de una matriz pero "
     213     "no el número de celdas, filas o columnas")+
     214    cint_url_link,
     215  BOperClassify::Conversion_);
     216  void BDatCINT_import_from_tol::CalcContens()
     217//--------------------------------------------------------------------
     218{
     219  if(CheckNonDeclarativeAction("Cint.import_from_tol")) { return; }
    213220 
    214221  BSyntaxObject* var = NULL;
    … …  
    225232      int ptrNum = (int)ptr;
    226233      BText expression = BText("double& ")+var->Name()+" = *((double *)("<<ptrNum<<"))";
    227     //Std(BText("TRACE [Cint.import_tol_variable] ")+expression);
     234    //Std(BText("TRACE [Cint.import_from_tol] ")+expression);
    228235      G__exec_text(expression);
    229236      contens_ += 1;
    … …  
    238245        mat.Columns()<<","<<
    239246        " ((double *)("<<ptrNum<<")) ); 0;";
    240     //Std(BText("TRACE [Cint.import_tol_variable] ")+expression);
     247    //Std(BText("TRACE [Cint.import_from_tol] ")+expression);
    241248      G__exec_text(expression);
    242249      contens_ += 1;
    243250    }
     251    else if(gra==GraText())
     252    {
     253      BText& txt = Text(var);
     254      char* ptr = (char*)(txt.Buffer());
     255      int ptrNum = (int)ptr;
     256      BText expression = BText("Text ")+var->Name()+" ( "<<
     257        txt.Length()<<","<<
     258        " ((char *)("<<ptrNum<<")) ); 0;";
     259    //Std(BText("TRACE [Cint.import_from_tol] ")+expression);
     260      G__exec_text(expression);
     261      contens_ += 1;
     262    }
    244263    else
    245264    {
    246       Warning(BText("[Cint.import_tol_variable] ")+
     265      Warning(BText("[Cint.import_from_tol] ")+
    247266        "Cannot import TOL variables of type "<<gra->Name());
    248267    }
Note: See TracChangeset for help on using the changeset viewer.