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] ... 下一页 >> |