Changeset 6bef16c in tol


Ignore:
Timestamp:
Nov 4, 2009, 6:36:11 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
251e783
Parents:
1908267
Message:

Fixed #762

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

Location:
tol
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tol/bmath/mathobjects/dat.cpp

    r1908267 r6bef16c  
    11981198
    11991199//--------------------------------------------------------------------
     1200void BDat::PutValue(const BText& name, const BText& format)
     1201
     1202/*! Puts the real value of name in this or unknown if name is not
     1203 *  a valid real number
     1204 * \param name Value thet is assigned to BDat
     1205 */
     1206//--------------------------------------------------------------------
     1207{
     1208  value_ = nan_;
     1209  int ret = sscanf(name.String(),format.String(),&value_);
     1210  if(ret!=1)
     1211  {
     1212    value_ = nan_;
     1213  }
     1214}
     1215
     1216//--------------------------------------------------------------------
    12001217ostream& operator<< (ostream& os, const BArray<BDat>& arr)
    12011218
  • tol/bmath/mathobjects/tol_bdat.h

    r1908267 r6bef16c  
    192192
    193193  //! Updates with the values of BChar
    194   void   PutValue (const BChar* name);
     194  void PutValue (const BChar* name);
    195195  //! Updates with the values of BText
    196   void   PutValue (const BText& expr);    //dattext.cpp
     196  void PutValue (const BText& expr);    //dattext.cpp
     197  //! Updates with the values of BText and specified format
     198  void PutValue(const BText& name, const BText& format);
    197199  //! Updates \a value_ attribute with \a x
    198200  void   PutValue (BReal x) { value_ = x; }
  • tol/btol/real_type/datgrav.cpp

    r1908267 r6bef16c  
    16801680
    16811681
     1682//--------------------------------------------------------------------
     1683DeclareContensClass(BDat, BDatTemporary, BDatTextToReal);
     1684DefExtOpr(1, BDatTextToReal, "TextToReal", 1, 2, "Text Text",
     1685  "(Text txt [, Text format=\"%lg\"])",
     1686  I2("Convers to real a formatted text. You can specify any standard "
     1687     "C format for type double.",
     1688     "Convierte a real un texto formateado. Se puede especificar un "
     1689     "formato estándar cualquiera de C para el tipo double ")+
     1690  I2("\nWARNING: Not all formats are inversible. "
     1691     "For example, format strings with literals "
     1692     "they must be separated with a specified separator character.",
     1693     "\nCUIDADO: No todas las cadenas de formato tienen porqué ser inversibles. "
     1694     "Por ejemplo, si usan literales "
     1695     "éstos deben estar separados del resto por un caracter especificado."),
     1696          BOperClassify::TimeAlgebra_);
     1697//--------------------------------------------------------------------
     1698void BDatTextToReal::CalcContens()
     1699//--------------------------------------------------------------------
     1700{
     1701  BText& txt = Text(Arg(1));
     1702  if(!Arg(2))
     1703  {
     1704    contens_.PutValue(txt);
     1705  }
     1706  else
     1707  {
     1708    BText& fmt = Text(Arg(2));
     1709    contens_.PutValue(txt,fmt);
     1710  }
     1711}
    16821712
    16831713//--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.