当前位置: 首页>>代码示例>>C++>>正文


C++ TIniFile::WriteFloat方法代码示例

本文整理汇总了C++中TIniFile::WriteFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ TIniFile::WriteFloat方法的具体用法?C++ TIniFile::WriteFloat怎么用?C++ TIniFile::WriteFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TIniFile的用法示例。


在下文中一共展示了TIniFile::WriteFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveSettings

//---------------------------------------------------------------------------
// Сохраняю установки измерения в файл
bool SaveSettings(MeasurInfo& measurInfo)
{
        if (access(lpIniFileName.c_str(), 0) == 0)
        {
        	//
        	TIniFile *Ini = new TIniFile(lpIniFileName);
        	//
        	try
		{
                	if (Ini->SectionExists("History"))
                	{
                		Ini->WriteInteger("History", "type_check_watt", measurInfo.type_check_watt);
                		Ini->WriteFloat("History", "begin_lw", measurInfo.begin_lw);
                		Ini->WriteFloat("History", "end_lw", measurInfo.end_lw);
                		Ini->WriteFloat("History", "step_lw", measurInfo.step_lw);
                                Ini->WriteFloat("History", "calc_lw", measurInfo.calc_lw);
                		Ini->WriteFloat("History", "time_accumulation", measurInfo.time_accumulation);
                		Ini->WriteBool("History", "makeKorK_bw", measurInfo.makeKorK_bw);
                		Ini->WriteBool("History", "makeKorK_cw", measurInfo.makeKorK_cw);
                		Ini->WriteBool("History", "makeSetZero", measurInfo.makeSetZero);
                                return true;
                        }
		}
        	__finally
		{
	        	delete Ini;
                	Ini = NULL;
		}
        }
开发者ID:madruslan,项目名称:MeasurSpectr,代码行数:31,代码来源:CreateMeasur.cpp

示例2: btAjustaClick

//---------------------------------------------------------------------------
void __fastcall TfmAjustes::btAjustaClick(TObject *Sender)
{
try
  {
  int nponto, conf, P;
  float kconv1, kconv2, fval;
  String S;

  nponto = edNPonto->Text.ToInt();

  S = edKConv1->Text;
  if ( ( P = S.Pos(",") ) !=0 )
    {
    S[P] = '.';
    }
  fval = atof(S.c_str());
  if ( fval >= HUGE_VAL || fval <= -HUGE_VAL || fval == 0 )
     {
     throw Exception("Invalid kconv1.");
     }
  kconv1 = fval;

  S = edKConv2->Text;
  if ( ( P = S.Pos(",") ) != 0 )
    {
    S[P] = '.';
    }
  fval = atof(S.c_str());
  if ( fval >= HUGE_VAL || fval <= -HUGE_VAL )
    {
    throw Exception("Invalid kconv2.");
    }
  kconv2 = fval;

  conf = edConf->Text.ToInt();

  if ( nponto <= 0 )
    {
    throw Exception("Invalid point number.");
    }

  if ( ( int (nponto + kconv1 + kconv2) % 11) +
       ( int (nponto + kconv1 + kconv2) % 17)
       != conf )
    {
    throw Exception("Invalid Data.");
    }

  TIniFile *pIni = new TIniFile( ".\\conf\\adjusts.ini" );
  pIni->WriteFloat( nponto, "KCONV1", kconv1 );
  pIni->WriteFloat( nponto, "KCONV2", kconv2 );
  delete pIni;

  lbErro->Caption = "OK!";
  }
catch ( Exception &E )
  {
  lbErro->Caption = "ERROR! " + E.Message;
  }

}
开发者ID:focusenergy,项目名称:oshmi,代码行数:62,代码来源:ajustes.cpp


注:本文中的TIniFile::WriteFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。