double a;
int nA;
UnicodeString b = "12.4";
UnicodeString c = "-";
UnicodeString d = "";
UnicodeString e = "CELL";
UnicodeString f = "NO";
UnicodeString g = NULL;
if(TryStrToFloat(b, a) == true) Memo1->Lines->Add(FormatFloat("0.0", a));
if(TryStrToFloat(c, a) == true) Memo1->Lines->Add(FormatFloat("0.0", a));
else Memo1->Lines->Add("-1");
if(TryStrToInt(d, nA) == true) Memo1->Lines->Add(FormatFloat("0", nA));
else Memo1->Lines->Add("-1");
if(TryStrToInt(e, nA) == true) Memo1->Lines->Add(FormatFloat("0", nA));
else Memo1->Lines->Add("-1");
if(TryStrToInt(f, nA) == true) Memo1->Lines->Add(FormatFloat("0", nA));
else Memo1->Lines->Add("-1");
if(TryStrToInt(g, nA) == true) Memo1->Lines->Add(FormatFloat("0", nA));
else Memo1->Lines->Add("-1");
==> NULL to 0 (NULL은 0으로 변환)
댓글