首部 function StrPLCopy(Dest: PChar; const Source: string; MaxLen: Cardinal): PChar; $ of Char;
begin
StrPLCopy(vBuffer, Edit1.Text, SpinEdit1.Value);
Edit2.Text := vBuffer;
end;
///////End StrPLCopy
━━━━━━━━━━━━━━━━━━━━━
首部 function StrCat(Dest: PChar; const Source: PChar): PChar; $ of Char;
begin
StrPCopy(vBuffer, Edit1.Text);
StrCat(vBuffer, PChar(Edit2.Text));
Edit3.Text := vBuffer;
end;
///////End StrCat
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLCat(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar; $MaxLen指定连接后的最大长度不是指针字符串Source的长度
参考 <NULL>
例子
///////Begin StrLCat
procedure TForm1.Button1Click(Sender: TObject);
var
vBuffer: array of Char;
begin
StrPCopy(vBuffer, Edit1.Text);
StrLCat(vBuffer, PChar(Edit2.Text), SpinEdit1.Value);
Edit3.Text := vBuffer;
end;
///////End StrLCat
━━━━━━━━━━━━━━━━━━━━━
首部 function StrComp(const Str1, Str2: PChar): Integer; $返回第一个出现不同字符的差异
参考 <NULL>
例子 SpinEdit1.Value := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrIComp(const Str1, Str2: PChar): Integer; $返回第一个出现不同字符的差异
参考 <NULL>
例子 SpinEdit1.Value := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer; $返回第一个出现不同字符的差异
参考 <NULL>
例子 SpinEdit1.Value := StrLComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer; $返回第一个出现不同字符的差异
参考 <NULL>
例子 SpinEdit1.Value := StrLIComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function StrScan(const Str: PChar; Chr: Char): PChar; $ 类型
Format('x=%d', ); //'x=12' //最普通
Format('x=%3d', ); //'x= 12' //指定宽度
Format('x=%f', ); //'x=12.00' //浮点数
Format('x=%.3f', ); //'x=12.000' //指定小数
Format('x=%.*f', ); //'x=12.00000' //动态配置
Format('x=%.5d', ); //'x=00012' //前面补充0
Format('x=%.5x', ); //'x=0000C' //十六进制
Format('x=%1:d%0:d', ); //'x=1312' //使用索引
Format('x=%p', ); //'x=00000000' //指针
Format('x=%1.1e', ); //'x=1.2E+001' //科学记数法
Format('x=%%', ); //'x=%' //得到"%"
S := Format('%s%d', ); //S := S + StrToInt(I); //连接字符串
参考 proceduer SysUtils.FmtStr
例子 Edit1.Text := Format(Edit2.Text, );
━━━━━━━━━━━━━━━━━━━━━
首部 procedure FmtStr(var Result: string; const Format: string; const Args: array of const); $) = '1024|1';
参考 function SysUtils.FormatBuf
例子 <参见Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function FormatBuf(var Buffer; BufLen: Cardinal; const Format; FmtLen: Cardinal; const Args: array of const): Cardinal; $ := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
ffGeneral, SpinEdit1.Value, SpinEdit2.Value);
Memo1.Lines.Values := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
ffExponent, SpinEdit1.Value, SpinEdit2.Value);
Memo1.Lines.Values := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
ffFixed, SpinEdit1.Value, SpinEdit2.Value);
Memo1.Lines.Values := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
ffNumber, SpinEdit1.Value, SpinEdit2.Value);
Memo1.Lines.Values := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
ffCurrency, SpinEdit1.Value, SpinEdit2.Value);
end;
///////End FloatToStrF
━━━━━━━━━━━━━━━━━━━━━
首部 function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits: Integer): string; $ := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
ffGeneral, SpinEdit1.Value);
Memo1.Lines.Values := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
ffExponent, SpinEdit1.Value);
Memo1.Lines.Values := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
ffFixed, SpinEdit1.Value);
Memo1.Lines.Values := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
ffNumber, SpinEdit1.Value);
Memo1.Lines.Values := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
ffCurrency, SpinEdit1.Value);
end;
///////End CurrToStrF
━━━━━━━━━━━━━━━━━━━━━
首部 function FloatToText(BufferArg: PChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer; $ of Char;
E: Extended;
begin
E := StrToFloatDef(Edit1.Text, 0);
SpinEdit3.Value := FloatToText(vBuffer, E,
fvExtended, ffNumber, SpinEdit1.Value, SpinEdit2.Value);
Edit2.Text := Copy(vBuffer, 1, SpinEdit3.Value);
end;
///////End FloatToText(
━━━━━━━━━━━━━━━━━━━━━
