本文整理汇总了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;
}
}
示例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;
}
}