?? 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 + -