📄 format.txt
字号:
edit1.Text:=format('测试 %d',[B]) //B必须为整数
Decimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zero
edit1.Text:=format('测试 %s',[B]) //B必须为字符串
String. The argument must be a character, a string, or a PChar value. The string or character is inserted in place of the format specifier. The precision specifier, if present in the format string, specifies the maximum length of the resulting string. If the argument is a string that is longer than this maximum, the string is truncated.
edit1.Text:=format('耐火极限 %g小时',[B]) //B必须为浮点型
General. The argument must be a floating-point value. The value is converted to the shortest possible decimal string using fixed or scientific format. The number of significant digits in the resulting string is given by the precision specifier in the format string梐 default precision of 15 is assumed if no precision specifier is present.Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format.
刚写的DBGRID导入到EXCELL
procedure TFormGzqkHZ.DataToExcel(aPath: string);
var
MySQL,ConnStr: string;
begin
ConnStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;Data Source=' + aPath + ';Persist Security Info=False';
MySQL := 'SELECT * INTO [SHEET1] FROM TBLGZFFQKLS IN [ODBC]' + ' [ODBC;Driver=SQL Server;UID=sa;PWD=;Server='+ frmMain.IpCode +';DataBase=SalaryAuidit;]';
try
ADOConnExcel.Connected := False;
ADOConnExcel.ConnectionString := ConnStr;
ADOConnExcel.Connected := True;
ADOConnExcel.Execute(MySQL);
Application.MessageBox('导出EXCEL成功','信息提示!',mb_ok+mb_iconinformation);
ADOConnExcel.Connected := False;
except
Application.MessageBox('导出EXCEL失败','错误!',mb_ok+mb_iconStop);
ADOConnExcel.Connected := False;
end;
end;
ADOConnection1.Execute('SELECT * INTO newTable FROM [Sheet1$] IN "C:\...\myFile.xls" "Excel 8.0;" ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -