⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 borland c++ builder vcl的数值转换函数.txt

📁 文章介绍:1.将整数转换为AnsiString字符串 2.将整数转换为十六进制字符串 3.将AnsiString字符串转换为整数值
💻 TXT
字号:
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. 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);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -