五.Borland C++ Builder VCL的數值轉換函式
1. IntToStr
將整數轉換為AnsiString字串,函數原型如下:
AnsiString __fastcall IntToStr(int Value);
2. IntToHex
將整數轉換為十六進位字串,函數原型如下:
AnsiString __fastcall IntToHex(int Value, int Digits);
3. StrToInt
將AnsiString字串轉換為整數值,如果不能進行轉換,則產生EConvertError異常,
函數原型如下:
int __fastcall StrToInt(const AnsiString S);
4. StrToIntDef
將AnsiString字串轉換為一個數值,函數原型如下:
int __fastcall StrToIntDef(const System::AnsiString S,int Default);
5. FloatToStr
將浮點數轉換為AnsiString字串,函數原型如下:
AnsiString __fastcall FloatToStr(Extended Value);
6. StrToFloat
將AnsiString字串轉換為一個浮點數值,函數原型如下:
Extended __fastcall StrToFloat(const AnsiString S);
7. FloatToStrF
將浮點數轉換為指定格式的AnsiString字串,函數原型如下:
AnsiString __fastcall FloatToStrF(Extended Value, TFloatFormat Format,int Precision, int Digits);
六.Borland C++ Builder VCL的時間函數
1. Date
返回TDateTime對象,包含當前的年月日資訊,函數原型如下:
System::TDateTime __fastcall Date(void);
2. Time
返回TDateTime對象,包含當前的時間資訊,函數原型如下:
System::TDateTime __fastcall Time(void);
3. Now
返回TDateTime對象,擷取當前的日期和時間資訊,函數原型如下:
System::TDateTime __fastcall Now(void);
4. DatetimeToString
將TDateTime對象轉換為指定格式的字串對象,函數原型如下:
void __fastcall DateTimeToString(AnsiString &;Result, const AnsiString Format,System::TDateTime DateTime);
5. DateToStr
將TDateTime對象(包含當前年月日資訊)轉換為字串對象,函數原型如下:
AnsiString __fastcall DateToStr(System::TDateTime Date);
6. TimeToStr
將當前日期轉換為字串對象,函數原型如下:
AnsiString __fastcall TimeToStr(System::TDateTime Time);
7. DateTimetoStr
將TDateTime對象轉換為字串對象,函數原型如下:
AnsiString __fastcall DateTimeToStr(System::TDateTime DateTime);
8. StrToDate
將字串對象轉換為年月日對象,函數原型如下:
System::TDateTime __fastcall StrToDate(const AnsiString S);
9. StrToTime
將字串對象轉換時間對象,函數原型如下:
System::TDateTime __fastcall StrToTime(const AnsiString S);
10.StrToDateTime
將字串對象轉換為年月日時間對象,函數原型如下:
System::TDateTime __fastcall StrToDateTime(const AnsiString S);
11.DateTimeToSystemTime
將TDateTime對象轉換為作業系統時間,函數原型如下:
void __fastcall DateTimeToSystemTime(System::TDateTime DateTime, _SYSTEMTIME &;SystemTime);
12.SystemTimeToDateTime
將作業系統時間轉換為TDateTime對象,函數原型如下:
System::TDateTime __fastcall SystemTimeToDateTime(const _SYSTEMTIME &;SystemTime);
本文引用地址: http://blog.csdn.net/extcsdn/services/trackbacks/449494.aspx