C++Builder 6.0 常用函数

Posted 码城

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++Builder 6.0 常用函数相关的知识,希望对你有一定的参考价值。

更多函数,详见:

C++Builder 6.0 常用函数集合 - 码到城攻均收集自 Borland C++ Builder VCL 常用函数集合,提前了解,开发事半功倍https://www.codecomeon.com/posts/194/

时间函数

Date

返回TDateTime对象,包含当前的年月日信息,函数原型如下:

System::TDateTime __fastcall Date(void);

Time

返回TDateTime对象,包含当前的时间信息,函数原型如下:

System::TDateTime __fastcall Time(void);

Now

返回TDateTime对象,获取当前的日期和时间信息,函数原型如下:

System::TDateTime __fastcall Now(void);

DatetimeToString

将TDateTime对象转换为指定格式的字符串对象,函数原型如下:

void __fastcall DateTimeToString(AnsiString &;Result, const AnsiString Format,System::TDateTime DateTime);

DateToStr

将TDateTime对象(包含当前年月日信息)转换为字符串对象,函数原型如下:

AnsiString __fastcall DateToStr(System::TDateTime Date);

TimeToStr

将当前日期转换为字符串对象,函数原型如下:

AnsiString __fastcall TimeToStr(System::TDateTime Time);

DateTimeToStr

将TDateTime对象转换为字符串对象,函数原型如下:

AnsiString __fastcall DateTimeToStr(System::TDateTime DateTime);

StrToDate

将字符串对象转换为年月日对象,函数原型如下:

System::TDateTime __fastcall StrToDate(const AnsiString S);

StrToTime

将字符串对象转换时间对象,函数原型如下:

System::TDateTime __fastcall StrToTime(const AnsiString S);

StrToDateTime

将字符串对象转换为年月日时间对象,函数原型如下:

System::TDateTime __fastcall StrToDateTime(const AnsiString S);

DateTimeToSystemTime

将TDateTime对象转换为操作系统时间,函数原型如下:

void __fastcall DateTimeToSystemTime(System::TDateTime DateTime, _SYSTEMTIME &;SystemTime);

SystemTimeToDateTime

将操作系统时间转换为TDateTime对象,函数原型如下:

System::TDateTime __fastcall SystemTimeToDateTime(const _SYSTEMTIME &;SystemTime);

数值转换函数

IntToStr

将整数转换为AnsiString字符串,函数原型如下:

AnsiString __fastcall IntToStr(int Value);

IntToHex

将整数转换为十六进制字符串,函数原型如下:

AnsiString __fastcall IntToHex(int Value, int Digits);

StrToInt

将AnsiString字符串转换为整数值,如果不能进行转换,则产生EConvertError异常,函数原型如下:

int __fastcall StrToInt(const AnsiString S);

StrToIntDef

将AnsiString字符串转换为一个数值,函数原型如下:

int __fastcall StrToIntDef(const System::AnsiString S,int Default);

FloatToStr

将浮点数转换为AnsiString字符串,函数原型如下:

AnsiString __fastcall FloatToStr(Extended Value);

StrToFloat

将AnsiString字符串转换为一个浮点数值,函数原型如下:

Extended __fastcall StrToFloat(const AnsiString S);

FloatToStrF

将浮点数转换为指定格式的AnsiString字符串,函数原型如下:

AnsiString __fastcall FloatToStrF(Extended Value, TFloatFormat Format,int Precision, int Digits); 

字符串函数

UpperCase

将指定的AnsiString字符串转换为大写形式,函数原型如下:

AnsiString __fastcall UpperCase(const AnsiString S);

LowerCase

将指定的AnsiString字符串转换为小写形式,函数原型如下:

AnsiString __fastcall LowerCase(const AnsiString S);

CompareStr

比较两个AnsiString字符串,函数原型如下:

int __fastcall CompareStr(const AnsiString S1, const AnsiString S2);

CompareText

比较两个AnsiString字符串,函数原型如下:

int __fastcall CompareText(const AnsiString S1, const AnsiString S2);

StrLen

返回字符串的长度,函数原型如下:

Cardinal __fastcall StrLen(const char * Str);

StrEnd

返回字符串结尾指针,函数原型如下:

char * __fastcall StrEnd(const char * Str);

StrMove

从源字符串向目的字符串拷贝指定数目的字符,函数原型如下:

char * __fastcall StrMove(char * Dest, const char * Source, Cardinal Count);

StrCopy

将源字符串拷贝到目的字符串中,函数原型如下:

char * __fastcall StrCopy(char * Dest, const char * Source);

StrECopy

将源字符串拷贝到目的字符串中,并返回目的字符串结尾指针,函数原型如下:

char * __fastcall StrECopy(char * Dest, const char * Source);

StrLCopy

将源字符串指定数目的字符拷贝到目的字符串中,并返回目的字符串指针,函数原型如下:

char * __fastcall StrLCopy(char * Dest, const char * Source, Cardinal MaxLen);

StrPCopy

将AnsiString类型的源字符串拷贝到目的字符串中,并返回目的字符串指针,函数原型如下:

char * __fastcall StrPCopy(char * Dest, const AnsiString Source);

StrPLCopy

将源字符串(AnsiString类型)指定数目的字符拷贝到目的字符串中,并返回目的字符串指针,函数原型如下:

char * __fastcall StrPLCopy(char * Dest, const AnsiString Source, Cardinal MaxLen);

StrCat

连接两个字符串,并返回目的字符串指针,函数原型如下:

char * __fastcall StrCat(char * Dest, const char * Source);

StrLCat

将指定数目的源字符串连接到目的字符串,并返回目的字符串指针,函数原型如下:

char * __fastcall StrLCat(char * Dest, const char * Source, Cardinal MaxLen);

StrComp

两个字符串相到比较,返回比较的结果,函数原型如下:

int __fastcall StrComp(const char * Str1, const char * Str2);

StrIComp

两个字符串相互比较(不论大小写),返回比较的结果,函数原型如下:

int __fastcall StrIComp(const char * Str1, const char * Str2);

StrLComp

对两个字符串指定数目的字符进行比较操作,函数原型如下:

int __fastcall StrLComp(const char * Str1, const char * Str2, Cardinal MaxLen);

StrScan

在指定的字符串中寻找特定的字符,并返回字符串中第一个特定字符的指针,函数原型如下:

char * __fastcall StrScan(const char * Str, char Chr);

StrRScan

在指定的字符串中寻找特定的字符,并返回字符串中最后一个特定字符的指针,函数原型如下:

char * __fastcall StrRScan(const char * Str, char Chr);

StrPos

在Strl所指定的字符串中寻找Str2所指定的子字符串,并返回Str2在Str2中第一个子字符的指针,函数原型如下:

char * __fastcall StrPos(const char * Str1, const char * Str2);

StrUpper

将字符串转换为大写形式,函数原型如下:

char * __fastcall StrUpper(char * Str);

StrLower

将字符串转换为小写形式,函数原型如下:

char * __fastcall StrLower(char * Str);

StrPas

将指定的字符串转换为AnsiString类型字符串对象,函数原型如下:

AnsiString __fastcall StrPas(const char * Str);

StrAlloc

为字符串分配指定字节的内存,并返回内存指针,函数原型如下:

char * __fastcall StrAlloc(Cardinal Size);

StrBufSize

返回*Str所指向内存的大小,函数原型如下:

Cardinal __fastcall StrBufSize(const char * Str);

StrNew

在堆中为指定字符串分配空间,并将字符串拷贝到此空间中,函数原型如下:

char * __fastcall StrNew(const char * Str);

磁盘管理函数


更多函数,请移步:

C++Builder 6.0 常用函数集合 - 码到城攻均收集自 Borland C++ Builder VCL 常用函数集合,提前了解,开发事半功倍https://www.codecomeon.com/posts/194/

开发者涨薪指南 48位大咖的思考法则、工作方式、逻辑体系

以上是关于C++Builder 6.0 常用函数的主要内容,如果未能解决你的问题,请参考以下文章

C++Builder 6.0 IDEA扩展工具,开发助手

C++Builder 6.0 IDEA扩展工具,开发助手

C++Builder 6.0 学习资料收集整理

Borland C++ Builder 6.0的详细说明

rad studio 11可以打开c++builder6.0的工程吗

WPBakery Page Builder页面生成器6.0 汉化版