Changeset 96b1982 in tol
- Timestamp:
- Dec 11, 2010, 7:25:50 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 7519264
- Parents:
- bb16420
- File:
-
- 1 edited
-
tol/contrib/cint/tolCint.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/contrib/cint/tolCint.cpp
rbb16420 r96b1982 65 65 int G__init_cint_ = G__init_cint("cint"); 66 66 G__set_errmsgcallback(Cint_errmsgcallback); 67 G__setautoconsole(1); 67 68 return(G__init_cint_); 68 } ;69 } 69 70 70 71 //-------------------------------------------------------------------- … … 179 180 } 180 181 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", 185 188 "(Anything var1 [, Anything var2, ...])", 186 189 I2("Imports TOL variables, global or local, into CINT global scope.\n" 187 190 "Returns the number of imported variables\n" 188 191 "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", 195 193 "Importa variables TOL, globales o locales, al ámbito global de CINT\n" 196 194 "Devuelve el número total de variables correctamen te importadas.\n" 197 195 "Las variables TOL deben tener un nombre válido en los lenguajes " 198 196 "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")+ 200 198 " TOL CINT\n" 201 199 " Real double\n" 202 200 " 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 ", 204 203 "Puede ver la declaración de los correspondientes tipos C/C++ en ")+ 205 204 "\nhttps://www.tol-project.org/browser/tolp/trunk/tol/" 206 205 "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; } 213 220 214 221 BSyntaxObject* var = NULL; … … 225 232 int ptrNum = (int)ptr; 226 233 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); 228 235 G__exec_text(expression); 229 236 contens_ += 1; … … 238 245 mat.Columns()<<","<< 239 246 " ((double *)("<<ptrNum<<")) ); 0;"; 240 //Std(BText("TRACE [Cint.import_ tol_variable] ")+expression);247 //Std(BText("TRACE [Cint.import_from_tol] ")+expression); 241 248 G__exec_text(expression); 242 249 contens_ += 1; 243 250 } 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 } 244 263 else 245 264 { 246 Warning(BText("[Cint.import_ tol_variable] ")+265 Warning(BText("[Cint.import_from_tol] ")+ 247 266 "Cannot import TOL variables of type "<<gra->Name()); 248 267 }
Note: See TracChangeset
for help on using the changeset viewer.
