|
|
|
Delphi 函数参考 |
热 ★★★★ |
|
Delphi 函数参考 |
|
作者:闵涛 文章来源:闵涛的学习笔记 点击数:5704 更新时间:2009/4/23 18:27:19 |
|
sp; begin CheckBox1.Checked := TryStrToDateTime(Edit1.Text, vDateTime); Edit2.Text := DateTimeToStr(vDateTime); end; ///////End TryStrToDateTime ━━━━━━━━━━━━━━━━━━━━━ 首部 procedure DateTimeToString(var Result: string; const Format: string; DateTime: TDateTime); $[SysUtils.pas 功能 用指定的格式Format来格式化日期时间DateTime并返回到字符串Result中 说明 <参见FormatDateTime> 参考 function System.SetString 例子 <参见FormatDateTime> ━━━━━━━━━━━━━━━━━━━━━ 首部 function GetLocaleStr(Locale, LocaleType: Integer; const Default: string): string; platform; $[SysUtils.pas 功能 返回当前系统指定参数的字符串值 说明 GetLocaleStr(GetThreadLocale, LOCALE_SLANGUAGE, '''''''') = ''''中文(中国)'''' 参考 function Windows.GetLocaleInfo 例子 Edit1.Text := GetLocaleStr(GetThreadLocale, SpinEdit1.Value, ''''<NULL>''''); ━━━━━━━━━━━━━━━━━━━━━ 首部 function GetLocaleChar(Locale, LocaleType: Integer; Default: Char): Char; platform; $[SysUtils.pas 功能 返回当前系统指定参数的字符值 说明 GetLocaleChar(GetThreadLocale, LOCALE_STHOUSAND, #0) = '''','''' 参考 function Windows.GetLocaleInfo 例子 Edit1.Text := GetLocaleChar(GetThreadLocale, LOCALE_SLANGUAGE, #0); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ByteType(const S: string; Index: Integer): TMbcsByteType; $[SysUtils.pas 功能 返回字符串S位置Index上的字符在MBCS中类型 说明 多字节字符系统:Multi-Byte Character System (MBCS) 参考 var SysUtils.SysLocale 例子 SpinEdit1.Value := Ord(ByteType(Edit1.Text, SpinEdit2.Value)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType; $[SysUtils.pas 功能 返回指针字符串Str位置Index上的字符在MBCS中类型 说明 Index从0开始 参考 var SysUtils.SysLocale 例子 SpinEdit1.Value := Ord(StrByteType(PChar(Edit1.Text), SpinEdit2.Value)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ByteToCharLen(const S: string; MaxLen: Integer): Integer; $[SysUtils.pas 功能 返回字符串S中有多少个多字节字符 说明 MaxLen指定处理字符个数 参考 function SysUtils.ByteToCharIndex 例子 SpinEdit1.Value := ByteToCharLen(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function CharToByteLen(const S: string; MaxLen: Integer): Integer; $[SysUtils.pas 功能 返回字符串S中有多少个字符 说明 MaxLen指定处理多字节字符个数 参考 var SysUtils.SysLocale 例子 SpinEdit1.Value := CharToByteLen(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ByteToCharIndex(const S: string; Index: Integer): Integer; $[SysUtils.pas 功能 返回字符位置对应的多字节字符位置 说明 ByteToCharIndex(''''你好'''', 2) = 1;ByteToCharIndex(''''你好'''', 3) = 2 参考 function SysUtils.NextCharIndex 例子 SpinEdit1.Value := ByteToCharIndex(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function CharToByteIndex(const S: string; Index: Integer): Integer; $[SysUtils.pas 功能 返回多字节字符位置对应的字符起始位置 说明 CharToByteIndex(''''你好'''', 1) = 1;CharToByteIndex(''''你好'''', 2) = 3 参考 function System.Length 例子 SpinEdit1.Value := CharToByteIndex(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function StrCharLength(const Str: PChar): Integer; $[SysUtils.pas 功能 返回第一个字符的宽度 说明 参数为空则返回0 参考 function Windows.CharNext 例子 SpinEdit1.Value := StrCharLength(PChar(Edit1.Text)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function StrNextChar(const Str: PChar): PChar; $[SysUtils.pas 功能 返回字符指针Str的下一个字符指针 说明 StrNextChar(''''1234'''') = ''''234''''; 参考 function Windows.CharNext 例子 Edit2.Text := StrNextChar(PChar(Edit1.Text)); ━━━━━━━━━━━━━━━━━━━━━ 首部 function CharLength(const S: String; Index: Integer): Integer; $[SysUtils.pas 功能 返回字符串中指定位置的字符宽度 说明 CharLength(''''English汉'''', 1) = 1;CharLength(''''English汉'''', 8) = 2 参考 function System.Assert;function SysUtils.StrCharLength 例子 SpinEdit1.Value := CharLength(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function NextCharIndex(const S: String; Index: Integer): Integer; $[SysUtils.pas 功能 返回下一个字符的位置 说明 CharLength(''''你好'''', 1) = 3;CharLength(''''你好'''', 3) = 5 参考 function System.Assert;function SysUtils.StrCharLength 例子 SpinEdit1.Value := NextCharIndex(Edit1.Text, SpinEdit2.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function IsPathDelimiter(const S: string; Index: Integer): Boolean; $[SysUtils.pas 功能 返回字符串S中指定位置Index上是否是一个路径分隔符 说明 IsPathDelimiter(''''C:\Windows'''', 3) = True 参考 const SysUtils.PathDelim;function SysUtils.ByteType 例子 CheckBox1.Checked := IsPathDelimiter(Edit1.Text, SpinEdit1.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function IsDelimiter(const Delimiters, S: string; Index: Integer): Boolean; $[SysUtils.pas 功能 返回字符串S中指定位置Index上是否是一个分隔符Delimiters 说明 IsDelimiter(''''@'''', ''''wjhu111@21cn.com'''', 8) = True 参考 function SysUtils.ByteType 例子 CheckBox1.Checked := IsDelimiter(Edit1.Text, Edit2.Text, SpinEdit1.Value); ━━━━━━━━━━━━━━━━━━━━━ 首部 function IncludeTrailingPathDelimiter(const S: string): string; $[SysUtils.pas 功能 返回包括最后路径分隔符 说明 最后一个字符是路径分隔符则不变;否则加上一个路径分隔符返回 参考 function SysUtils.IsPathDelimiter;function System.Length 例子 Edit1.Text := IncludeTrailingPathDelimiter(Edit2.Text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function IncludeTrailingBackslash(const S: string): string; platform; $[SysUtils.pas 功能 返回包括最后斜线 说明 Result := IncludeTrailingPathDelimiter(S); 参考 function SysUtils.IncludeTrailingPathDelimiter 例子 Edit1.Text := IncludeTrailingBackslash(Edit2.Text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ExcludeTrailingPathDelimiter(const S: string): string; $[SysUtils.pas 功能 返回排除最后路径分隔符 说明 最后一个字符不是路径分隔符则不变;否则减去最后的路径分隔符返回 参考 function SysUtils.IsPathDelimiter;function System.Length;function System.SetLength 例子 Edit1.Text := ExcludeTrailingPathDelimiter(Edit2.Text); ━━━━━━━━━━━━━━━━━━━━━ 首部 function ExcludeTrailingBackslash(const S: string): string; platform;  上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> [系统软件]InstallShield Express for delphi制作安装程序定… [常用软件]InstallShield Express制作Delphi数据库安装程序 [Delphi程序]为什么选择Delphi.Net ? [Delphi程序]《关于VisiBroker For Delphi的使用》(4) [Delphi程序]Delphi 程序员代码编写标准指南 [Delphi程序]转贴:Conversion to Delphi 6: Missing unit Pro… [Delphi程序]Borland Delphi 9 的新特性 [Delphi程序]Delphi 键盘码表 [Delphi程序]Chuck Jazdzewski的离开意味着Delphi的终结吗? [Delphi程序]Delphi Access violations 问题的解决之道
|
|
教程录入:mintao 责任编辑:mintao |
|
|
上一篇教程: 将网页显示的 Delphi 代码上色并格式化 下一篇教程: 强大的DELPHI RTTI--兼谈需要了解多种开发语言 |
|
|
【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |
|
注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网] |
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
|
|
|
|
|
|
|
同类栏目 |
|
|
赞助链接 |
|
|
500 - 内部服务器错误。
|
|
|
|
|
|