<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>文丰博客</title><link>http://www.clzwf.top/</link><description>微信号：clxzwf</description><item><title>Lazarus DBGrid 控件进阶技巧：列标题换行与行高自定义</title><link>http://www.clzwf.top/?id=10</link><description>&lt;pre class=&quot;prism-highlight prism-language-pascal&quot;&gt;&lt;br/&gt;&lt;/pre&gt;&lt;h1 style=&quot;box-sizing: border-box; font-size: 37px; margin: 0px; padding: 0px; line-height: 56px; font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Rototo, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Lazarus DBGrid 控件进阶技巧：列标题换行与行高自定义&lt;br/&gt;&lt;/h1&gt;&lt;div class=&quot;article-meta&quot; style=&quot;box-sizing: border-box; margin: 16px 0px 32px; padding: 0px; line-height: 20px; color: rgb(112, 112, 112); font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Rototo, Helvetica, Arial, sans-serif; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; display: inline-block; cursor: auto;&quot;&gt;2026-02-24 12:55&lt;/span&gt;&lt;span class=&quot;dot&quot; style=&quot;box-sizing: border-box; display: inline-block; cursor: auto; margin: 0px 4px;&quot;&gt;·&lt;/span&gt;&lt;span class=&quot;name&quot; style=&quot;box-sizing: border-box; display: inline-block; cursor: auto;&quot;&gt;&lt;a href=&quot;https://www.toutiao.com/c/user/token/MS4wLjABAAAAIkXzziYq4k6gqvgeRU5oUvrcdpMEm6SFE98MaWCD7L_xzI3VFvv4HpGn6oltAkGc/?source=tuwen_detail&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; style=&quot;box-sizing: border-box; background-color: transparent; cursor: pointer; text-decoration-line: none; color: rgb(112, 112, 112);&quot;&gt;长岭文丰&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Rototo, Helvetica, Arial, sans-serif; font-size: medium; text-wrap-mode: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;article class=&quot;syl-article-base syl-page-article tt-article-content syl-device-pc&quot; style=&quot;box-sizing: border-box; padding: 0px; text-align: justify; overflow-wrap: break-word; word-break: break-word; overflow: hidden; hyphens: auto; margin-bottom: 20px; color: rgb(34, 34, 34); font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Arial, sans-serif; line-height: 1.667; font-size: 18px;&quot;&gt;&lt;p data-track=&quot;1&quot; style=&quot;box-sizing: border-box; margin-bottom: 20px; padding: 0px; border: 0px; margin-top: 0px !important;&quot;&gt;Lazarus DBGrid 控件进阶技巧：列标题换行与行高自定义&lt;/p&gt;&lt;p data-track=&quot;2&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;在 Lazarus 开发中，DBGrid 是最常用的数据展示控件之一。然而，在实际开发过程中，我们经常会遇到一些看似简单却不易解决的问题，比如列标题换行和行高自定义。本文将详细介绍这两个常见需求的实现方法。&lt;/p&gt;&lt;p data-track=&quot;3&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;一、DBGrid 列标题换行实现&lt;/p&gt;&lt;p data-track=&quot;4&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;问题背景&lt;/p&gt;&lt;p data-track=&quot;5&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;在默认情况下，DBGrid 的列标题是单行显示的。当列标题文字较长时，要么被截断，要么需要很宽的列宽才能完整显示，影响界面美观。&lt;/p&gt;&lt;p data-track=&quot;6&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;解决方案&lt;/p&gt;&lt;p data-track=&quot;7&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;要实现列标题的多行显示，需要完成以下两个步骤：&lt;/p&gt;&lt;p data-track=&quot;8&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;1. 设置 Title.Multiline 属性为 True&lt;/p&gt;&lt;p data-track=&quot;9&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;在 DBGrid 的列编辑器中，选中需要换行的列，将其 Title.Multiline 属性设置为 True。&lt;/p&gt;&lt;p data-track=&quot;10&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;2. 在 Caption 中插入换行符&lt;/p&gt;&lt;p data-track=&quot;11&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;在列的 Title.Caption 属性中，使用 #13#10 来指定换行位置。&lt;/p&gt;&lt;p data-track=&quot;12&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;代码示例&lt;/p&gt;&lt;pre class=&quot;syl-page-code&quot; style=&quot;box-sizing: border-box; font-family: Monaco; font-size: 1em; margin-top: 20px; margin-bottom: 20px; padding: 15px; border: 0px; background-color: rgb(250, 250, 250); text-wrap-mode: wrap; word-break: break-all; overflow-x: auto; border-radius: 3px; text-align: left; box-shadow: rgba(216, 216, 216, 0.5) 0px 0px 0px 1px inset;&quot;&gt;//&amp;nbsp;方法一：在设计器中设置//&amp;nbsp;双击&amp;nbsp;DBGrid&amp;nbsp;打开列编辑器，设置对应列的&amp;nbsp;Title.Multiline&amp;nbsp;=&amp;nbsp;True//&amp;nbsp;并在&amp;nbsp;Title.Caption&amp;nbsp;中输入：第一行#13#10第二行//&amp;nbsp;方法二：在代码中动态设置DBGrid1.Columns[0].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
DBGrid1.Columns[0].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;客户&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;信息&amp;#39;;
DBGrid1.Columns[1].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
DBGrid1.Columns[1].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;联系&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;方式&amp;#39;;&lt;/pre&gt;&lt;p data-track=&quot;21&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;效果说明&lt;/p&gt;&lt;p data-track=&quot;22&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;设置完成后，列标题将按照 #13#10 的位置进行换行显示，可以有效节省横向空间，使界面更加紧凑美观。&lt;/p&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;二、DBGrid 行高自定义实现&lt;/h1&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; data-track=&quot;24&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;问题背景&lt;/h1&gt;&lt;p data-track=&quot;25&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;DBGrid 控件提供了 DefaultRowHeight 属性来设置数据行的默认高度，但对于标题行的高度，DBGrid 没有直接公开的属性来修改。&lt;/p&gt;&lt;p data-track=&quot;26&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;属性与方法说明&lt;/p&gt;&lt;div class=&quot;tableWrapper&quot; style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;div class=&quot;syl-shadow-provider&quot; style=&quot;box-sizing: border-box; margin: 20px 0px; padding: 0px; border: 0px; position: relative; overflow: hidden;&quot;&gt;&lt;div class=&quot;syl-table-wrap&quot; style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; max-width: 100%; overflow: auto hidden;&quot;&gt;&lt;table width=&quot;628&quot;&gt;&lt;colgroup style=&quot;box-sizing: border-box;&quot;&gt;&lt;col style=&quot;box-sizing: border-box; width: 165px;&quot;/&gt;&lt;col style=&quot;box-sizing: border-box; width: 205px;&quot;/&gt;&lt;col style=&quot;box-sizing: border-box; width: 258px;&quot;/&gt;&lt;/colgroup&gt;&lt;tbody style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;200&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;属性/方法&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;202&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;说明&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;204&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;访问级别&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;206&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;DefaultRowHeight&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;208&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;设置数据行的默认高度&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;210&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;Public，可直接访问&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;212&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;ResizeRow&lt;/p&gt;&lt;p data-track=&quot;217&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;RowHeights&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;214&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;调整指定行的高度&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;216&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;Protected，需特殊技巧访问&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p data-track=&quot;30&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;注意：DBGrid 虽然继承自 TCustomGrid，但 ResizeRow方法和RowHeights 属性在 DBGrid 中不可直接访问，需要通过特殊技巧来修改标题行高度。&lt;/p&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;解决方案：类继承技巧访问 ResizeRow 方法&lt;/h1&gt;&lt;p data-track=&quot;32&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;由于 ResizeRow 方法和RowHeights 属性是 protected（受保护） 的，无法在外部直接调用，我们需要通过类继承技巧来访问。&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-pascal&quot; style=&quot;box-sizing: border-box; font-family: Monaco; font-size: 1em; margin-top: 20px; margin-bottom: 20px; padding: 15px; border: 0px; background-color: rgb(250, 250, 250); text-wrap-mode: wrap; word-break: break-all; overflow-x: auto; border-radius: 3px; text-align: left; box-shadow: rgba(216, 216, 216, 0.5) 0px 0px 0px 1px inset;&quot;&gt;unit&amp;nbsp;Unit1;
{mode&amp;nbsp;objfpc}{H+}
interface
uses
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Classes,&amp;nbsp;SysUtils,&amp;nbsp;Forms,&amp;nbsp;Controls,&amp;nbsp;Graphics,&amp;nbsp;Dialogs,&amp;nbsp;Grids,&amp;nbsp;DBGrids,&amp;nbsp;DB;
type	
	//&amp;nbsp;关键技巧：创建继承自&amp;nbsp;TCustomGrid&amp;nbsp;的辅助类
	//&amp;nbsp;不需要添加任何新方法，只是为了访问&amp;nbsp;protected&amp;nbsp;成员
TMyGrid&amp;nbsp;=&amp;nbsp;class(TCustomGrid);
TForm1&amp;nbsp;=&amp;nbsp;class(TForm)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1:&amp;nbsp;TDBGrid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DataSource1:&amp;nbsp;TDataSource;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;		procedure&amp;nbsp;InitDBGrid;
&amp;nbsp;&amp;nbsp;public
&amp;nbsp;&amp;nbsp;end;
&amp;nbsp;&amp;nbsp;var
	Form1:&amp;nbsp;TForm1;
implementation
{R&amp;nbsp;*.lfm}
//&amp;nbsp;初始化&amp;nbsp;DBGrid&amp;nbsp;设置
procedure&amp;nbsp;TForm1.InitDBGrid;
begin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置数据行默认高度
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.DefaultRowHeight&amp;nbsp;:=&amp;nbsp;30;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;通过类型转换访问&amp;nbsp;ResizeRow&amp;nbsp;方法
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;参数说明：ResizeRow(行索引,&amp;nbsp;新高度)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;行索引&amp;nbsp;0&amp;nbsp;表示标题行，1&amp;nbsp;开始是数据行
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TMyGrid(DBGrid1).ResizeRow(0,&amp;nbsp;45);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;启用列标题换行
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[0].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[0].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;用户&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;姓名&amp;#39;;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[1].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[1].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;联系&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;电话&amp;#39;;
end;
//&amp;nbsp;窗体显示时初始化
procedure&amp;nbsp;TForm1.FormShow(Sender:&amp;nbsp;TObject);
begin
		InitDBGrid;
end;
end.&lt;/pre&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;三、完整示例：列标题换行 + 行高调整&lt;/h1&gt;&lt;p data-track=&quot;79&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;下面是一个完整的示例，同时实现列标题换行和行高自定义：&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-pascal&quot; style=&quot;box-sizing: border-box; font-family: Monaco; font-size: 1em; margin-top: 20px; margin-bottom: 20px; padding: 15px; border: 0px; background-color: rgb(250, 250, 250); text-wrap-mode: wrap; word-break: break-all; overflow-x: auto; border-radius: 3px; text-align: left; box-shadow: rgba(216, 216, 216, 0.5) 0px 0px 0px 1px inset;&quot;&gt;unit&amp;nbsp;Unit1;
{mode&amp;nbsp;objfpc}{H+}
interface
uses
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Classes,&amp;nbsp;SysUtils,&amp;nbsp;Forms,&amp;nbsp;Controls,&amp;nbsp;Graphics,&amp;nbsp;Dialogs,&amp;nbsp;Grids,&amp;nbsp;DBGrids,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DB,&amp;nbsp;SQLite3Conn,&amp;nbsp;SQLDB;
type
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;用于访问&amp;nbsp;protected&amp;nbsp;方法的辅助类
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TMyGrid&amp;nbsp;=&amp;nbsp;class(TCustomGrid);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TForm1&amp;nbsp;=&amp;nbsp;class(TForm)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1:&amp;nbsp;TDBGrid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DataSource1:&amp;nbsp;TDataSource;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLQuery1:&amp;nbsp;TSQLQuery;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLite3Connection1:&amp;nbsp;TSQLite3Connection;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;btnApply:&amp;nbsp;TButton;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;InitDBGrid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;ApplyRowHeight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;btnApplyClick(Sender:&amp;nbsp;TObject);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
var
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Form1:&amp;nbsp;TForm1;
implementation
{R&amp;nbsp;*.lfm}
//&amp;nbsp;初始化&amp;nbsp;DBGrid&amp;nbsp;列设置
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;TForm1.InitDBGrid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;begin//&amp;nbsp;启用标题换行DBGrid1.Columns[0].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[0].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;用户&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;姓名&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[1].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[1].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;联系&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;电话&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[2].Title.Multiline&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.Columns[2].Title.Caption&amp;nbsp;:=&amp;nbsp;&amp;#39;注册&amp;#39;&amp;nbsp;+&amp;nbsp;#13#10&amp;nbsp;+&amp;nbsp;&amp;#39;日期&amp;#39;;//&amp;nbsp;自动调整列宽以适应内容DBGrid1.AutoAdjustColumns&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置行高
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;TForm1.ApplyRowHeight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;begin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置数据行默认高度
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DBGrid1.DefaultRowHeight&amp;nbsp;:=&amp;nbsp;30;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置标题行高度（配合多行标题显示）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;通过类型转换访问&amp;nbsp;protected&amp;nbsp;的&amp;nbsp;ResizeRow&amp;nbsp;方法
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TMyGrid(DBGrid1).ResizeRow(0,&amp;nbsp;50);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;按钮点击事件
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;TForm1.btnApplyClick(Sender:&amp;nbsp;TObject);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;begin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ApplyRowHeight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;窗体显示时初始化
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;procedure&amp;nbsp;TForm1.FormShow(Sender:&amp;nbsp;TObject);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;begin
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;加载数据
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLQuery1.Open;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;初始化列设置
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InitDBGrid;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置行高
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ApplyRowHeight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
end.&lt;/pre&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;四、注意事项&lt;/h1&gt;&lt;p data-track=&quot;151&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;1. 关于换行符&lt;/p&gt;&lt;p data-track=&quot;152&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- #13#10 是 Windows 标准的换行符（CR+LF）&lt;/p&gt;&lt;p data-track=&quot;153&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 在 Linux/macOS 上可能需要使用 #10（LF）&lt;/p&gt;&lt;p data-track=&quot;154&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- Lazarus 的 LCL 通常会自动处理跨平台换行符&lt;/p&gt;&lt;p data-track=&quot;155&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;2. 关于行高设置时机&lt;/p&gt;&lt;p data-track=&quot;156&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 必须在 DBGrid 完成初始化后调用&lt;/p&gt;&lt;p data-track=&quot;157&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 建议在数据加载完成后执行&lt;/p&gt;&lt;p data-track=&quot;158&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 如果动态切换标题换行状态，需要重新调整标题行高度&lt;/p&gt;&lt;p data-track=&quot;159&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;3. ResizeRow 方法说明：&lt;/p&gt;&lt;p data-track=&quot;218&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;参数1： 行索引（0 = 标题行，1 开始 = 数据行）&lt;/p&gt;&lt;p data-track=&quot;162&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;参数2： 新的行高度（像素）&lt;/p&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;4. 辅助类定义位置&lt;/h1&gt;&lt;p data-track=&quot;181&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;TMyGrid 辅助类可以定义在：&lt;/p&gt;&lt;p data-track=&quot;182&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 单元的 type 部分（推荐）&lt;/p&gt;&lt;p data-track=&quot;183&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 单独的单元文件中&lt;/p&gt;&lt;p data-track=&quot;184&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;- 项目的公共单元中（便于多处复用）&lt;/p&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;五、总结&lt;/h1&gt;&lt;div class=&quot;tableWrapper&quot; style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;div class=&quot;syl-shadow-provider&quot; style=&quot;box-sizing: border-box; margin: 20px 0px; padding: 0px; border: 0px; position: relative; overflow: hidden;&quot;&gt;&lt;div class=&quot;syl-table-wrap&quot; style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; max-width: 100%; overflow: auto hidden;&quot;&gt;&lt;table width=&quot;643&quot;&gt;&lt;colgroup style=&quot;box-sizing: border-box;&quot;&gt;&lt;col style=&quot;box-sizing: border-box; width: 136px;&quot;/&gt;&lt;col style=&quot;box-sizing: border-box; width: 264px;&quot;/&gt;&lt;col style=&quot;box-sizing: border-box; width: 243px;&quot;/&gt;&lt;/colgroup&gt;&lt;tbody style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot; class=&quot;firstRow&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;220&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;功能&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;222&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;实现方法&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;224&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;关键代码&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;226&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;列标题换行&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;228&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;设置 Title.Multiline := True + Caption 中添加 #13#10&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;230&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;DBGrid1.Columns[0].Title.Multiline := True&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;232&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;数据行高度&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;234&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;使用 DefaultRowHeight 属性&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;236&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;DBGrid1.DefaultRowHeight := 30&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;238&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;标题行高度&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;240&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;继承 TCustomGrid 访问 ResizeRow 方法或RowHeights属性&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;box-sizing: border-box; margin: 0px; padding: 8px 12px; border-color: rgb(232, 232, 232); vertical-align: top; text-align: left; font-size: 16px; line-height: 28px; min-height: 44px;&quot;&gt;&lt;p data-track=&quot;242&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;TMyGrid(DBGrid1).ResizeRow(0, 45);&lt;/p&gt;&lt;p data-track=&quot;243&quot; class=&quot;syl-line-pure-english&quot; style=&quot;box-sizing: border-box; border: 0px;&quot;&gt;TMyGrid(DBGrid1).RowHeights[0]:= 45;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h1 class=&quot;pgc-h-forward-slash&quot; style=&quot;box-sizing: border-box; font-size: 1.056em; margin: 20px 0px; padding: 0px; border: 0px; line-height: 1.579; color: rgb(0, 0, 0); position: relative; width: 676px; vertical-align: middle;&quot;&gt;核心要点：&lt;/h1&gt;&lt;p data-track=&quot;191&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;1. 列标题换行：Title.Multiline := True + Caption 中加入 #13#10&lt;/p&gt;&lt;p data-track=&quot;192&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;2. 数据行高度：直接使用 DefaultRowHeight 属性&lt;/p&gt;&lt;p data-track=&quot;193&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;3. 标题行高度：通过 TMyGrid = class(TCustomGrid) 技巧访问 ResizeRow 方法或RowHeights属性&lt;/p&gt;&lt;p data-track=&quot;194&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;这两个技巧虽然简单，但在实际开发中非常实用。通过掌握这些方法，可以让你的 Lazarus DBGrid 界面更加美观和专业。&lt;/p&gt;&lt;p data-track=&quot;195&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;参考资源：&lt;/p&gt;&lt;p data-track=&quot;196&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;- Lazarus 官方文档：&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;https://www.lazarus-ide.org/&lt;/span&gt;&lt;/p&gt;&lt;p data-track=&quot;197&quot; style=&quot;box-sizing: border-box; margin-top: 20px; margin-bottom: 20px; padding: 0px; border: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;- Free Pascal 编译器文档：&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;https://www.freepascal.org/&lt;/span&gt;&lt;/p&gt;&lt;p data-track=&quot;198&quot; style=&quot;box-sizing: border-box; margin-top: 20px; padding: 0px; border: 0px; margin-bottom: 0px !important;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; margin: 0px; padding: 0px; border: 0px;&quot;&gt;- Lazarus 组件参考：&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;https://wiki.freepascal.org/DBGrid&lt;/span&gt;&lt;/p&gt;&lt;/article&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 24 Feb 2026 13:21:08 +0800</pubDate></item><item><title>粮食收购系统 Ver：3.9.1</title><link>http://www.clzwf.top/?id=9</link><description>&lt;!-- 头部区域 --&gt;&lt;header style=&quot;background:linear-gradient(135deg,#2c5364,#203a43,#0f2027);color:white;padding:60px 0;text-align:center;margin-bottom:40px;border-radius:8px;&quot;&gt;&lt;div style=&quot;max-width:800px;margin:0 auto;&quot;&gt;&lt;h1 style=&quot;font-size:2.5rem;margin-bottom:15px;&quot;&gt;粮食收购系统&lt;/h1&gt;&lt;p style=&quot;font-size:1.2rem;opacity:0.9;margin-bottom:20px;&quot;&gt;一款适用于中小粮食收购企业的自动检斤系统，操作简单，功能强大&lt;/p&gt;&lt;a href=&quot;#download&quot; style=&quot;display:inline-block;padding:12px 30px;background-color:#007bff;color:white;text-decoration:none;border-radius:5px;font-weight:bold;margin:0 7px;&quot; class=&quot;mobile-btn&quot;&gt;立即下载&lt;/a&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;#features&quot; style=&quot;display:inline-block;padding:12px 30px;background-color:#6c757d;color:white;text-decoration:none;border-radius:5px;font-weight:bold;margin:0 7px;&quot; class=&quot;mobile-btn&quot;&gt;了解功能&lt;/a&gt;&lt;/div&gt;&lt;/header&gt;&lt;!-- 软件简介 --&gt;&lt;section style=&quot;background-color:white;padding:40px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);margin-bottom:40px;&quot;&gt;&lt;h2 style=&quot;color:#2c5364;margin-bottom:20px;font-size:1.8rem;border-left:5px solid #007bff;padding-left:15px;&quot;&gt;软件简介&lt;/h2&gt;&lt;p style=&quot;font-size:1.1rem;margin-bottom:15px;color:#555;&quot;&gt;本软件是一款面向中小粮食收购企业的软件，操作简单，容易上手，一般企业员工无需电脑操作知识就可以操作，提升工作效率。&lt;/p&gt;&lt;p style=&quot;font-size:1.1rem;margin-bottom:15px;color:#555;&quot;&gt;软件采用简洁直观的操作界面，无需复杂学习即可上手，可实现自动读取电子秤数据，自动计算统计收购数据。无论是收购入库和销售出库，都能轻松应对。&lt;/p&gt;&lt;p style=&quot;font-size:1.1rem;color:#555;&quot;&gt;软件有两种授权方式，一是永久授权，二是按年授权。&lt;/p&gt;&lt;/section&gt;&lt;!-- 核心功能 --&gt;&lt;section id=&quot;features&quot; style=&quot;margin-bottom:40px;&quot;&gt;&lt;h2 style=&quot;text-align:center;color:#2c5364;margin-bottom:30px;font-size:1.8rem;&quot;&gt;核心功能&lt;/h2&gt;&lt;div style=&quot;display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:25px;&quot;&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;自动检斤收购&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;支持批量处理各类数据格式，自动识别并清洗数据，大幅减少人工操作时间，数据处理效率提升80%以上。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;销售出库管理管理&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;自动分类整理文件，支持快速检索和预览，自定义标签和筛选条件，让文件管理更加有序。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;数据查询导出电子表格&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;兼容主流文件格式，支持一键导出为Excel、PDF、Word等格式，满足不同场景的输出需求。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;库存管理&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;内置多重加密机制，保护敏感数据安全，支持密码保护和权限管理，防止数据泄露。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;自定义报表模板&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;提供丰富的预设模板，支持自定义模板创建和保存，满足个性化使用需求。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; padding: 30px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; transition: transform 0.3s; transform: translateY(0px);&quot; onmouseover=&quot;this.style.transform=&amp;#39;translateY(-5px)&amp;#39;&quot; onmouseout=&quot;this.style.transform=&amp;#39;translateY(0)&amp;#39;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.3rem;&quot;&gt;自动备份数据&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;支持定时自动备份数据，多设备同步功能，确保数据永不丢失，随时随地访问。&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;!-- 更新日志 --&gt;&lt;section style=&quot;margin-bottom:40px;&quot;&gt;&lt;h2 style=&quot;text-align:center;color:#2c5364;margin-bottom:30px;font-size:1.8rem;&quot;&gt;更新日志&lt;/h2&gt;&lt;div style=&quot;margin-bottom:20px;border-bottom:1px solid #eee;padding-bottom:15px;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;版本：3.9.1 （2025-12-10）&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;1、新建“入库计算类”，把入库相关公式计算功能归集，便于统一处理和修改。&lt;/p&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;2、添加“价格表”功能，用于生成价格表。&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;3、修改入库报表，在报表尾部添加汇总数据，取消汇总报表。&lt;/p&gt;&lt;h3 style=&quot;text-wrap-mode: wrap; color: rgb(0, 123, 255); margin-bottom: 10px; font-size: 1.1rem;&quot;&gt;版本：3.9.0 （2025-12-2）&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;1 、数据库品种表中增加场地扣量比设置（掺杂扣量），按“净重*场地扣量比”填写掺杂扣量编辑框。&lt;/p&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;2、收购数据表增加“粮食价款&amp;quot;字段，粮食价款=结算单价*结算数量，公式从结算公式中提前半部分。&lt;/p&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;3、修改结算单和收购报表，增加粮食价款项目。&lt;/p&gt;&lt;h3 style=&quot;text-wrap-mode: wrap; color: rgb(0, 123, 255); margin-bottom: 10px; font-size: 1.1rem;&quot;&gt;版本：3.8.3 （2025-11-29）&lt;/h3&gt;&lt;p style=&quot;text-wrap-mode: wrap; color: rgb(102, 102, 102); line-height: 1.7;&quot;&gt;1、姓名编辑框回车时不弹出售粮人列表框问题&lt;/p&gt;&lt;p style=&quot;text-wrap-mode: wrap; color: rgb(102, 102, 102); line-height: 1.7;&quot;&gt;2、获取新编号不正确的问题。&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-wrap-mode: wrap; color: rgb(102, 102, 102); line-height: 1.7;&quot;&gt;3、修改出库报表模块去掉了动态分组，直接按收货单位和品种分组统计数据，修改了报表模板。&lt;/p&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;!-- 截图展示 --&gt;&lt;section style=&quot;margin-bottom:40px;&quot;&gt;&lt;h2 style=&quot;text-align:center;color:#2c5364;margin-bottom:30px;font-size:1.8rem;&quot;&gt;功能截图&lt;/h2&gt;&lt;div style=&quot;display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));gap:20px;&quot;&gt;&lt;div style=&quot;background-color:white;padding:15px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);text-align:center;&quot; class=&quot;mobile-grid&quot;&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2025/12/202512111765433477632923.png&quot; alt=&quot;软件主界面截图&quot; style=&quot;border-radius: 5px; border: 1px solid rgb(238, 238, 238); width: 408px; height: 310px;&quot; width=&quot;408&quot; height=&quot;310&quot; border=&quot;0&quot; vspace=&quot;0&quot; title=&quot;软件主界面截图&quot;/&gt;&lt;p style=&quot;margin-top:15px;color:#555;font-weight:500;&quot;&gt;软件主界面 - 简洁直观的操作布局&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color:white;padding:15px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);text-align:center;&quot; class=&quot;mobile-grid&quot;&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2025/12/202512111765433476693885.png&quot; alt=&quot;数据处理功能截图&quot; style=&quot;border-radius: 5px; border: 1px solid rgb(238, 238, 238); width: 454px; height: 313px;&quot; width=&quot;454&quot; height=&quot;313&quot; border=&quot;0&quot; vspace=&quot;0&quot; title=&quot;数据处理功能截图&quot;/&gt;&lt;p style=&quot;margin-top:15px;color:#555;font-weight:500;&quot;&gt;系统设置&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color:white;padding:15px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);text-align:center;&quot; class=&quot;mobile-grid&quot;&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2025/12/202512111765433476441309.png&quot; alt=&quot;文件管理功能截图&quot; style=&quot;border-radius: 5px; border: 1px solid rgb(238, 238, 238); width: 437px; height: 311px;&quot; width=&quot;437&quot; height=&quot;311&quot; border=&quot;0&quot; vspace=&quot;0&quot; title=&quot;文件管理功能截图&quot;/&gt;&lt;p style=&quot;margin-top:15px;color:#555;font-weight:500;&quot;&gt;入库检斤&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;background-color:white;padding:15px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);text-align:center;&quot; class=&quot;mobile-grid&quot;&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2025/12/202512111765433476168058.png&quot; alt=&quot;导出设置截图&quot; style=&quot;border-radius: 5px; border: 1px solid rgb(238, 238, 238); width: 415px; height: 289px;&quot; width=&quot;415&quot; height=&quot;289&quot; border=&quot;0&quot; vspace=&quot;0&quot; title=&quot;导出设置截图&quot;/&gt;&lt;p style=&quot;margin-top:15px;color:#555;font-weight:500;&quot;&gt;出口检斤&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;!-- 下载区域 --&gt;&lt;section id=&quot;download&quot; style=&quot;background-color:white;padding:40px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,0.1);margin-bottom:40px;text-align:center;&quot;&gt;&lt;h2 style=&quot;color:#2c5364;margin-bottom:20px;font-size:1.8rem;&quot;&gt;下载中心&lt;/h2&gt;&lt;p style=&quot;margin-bottom:25px;color:#666;font-size:1.1rem;&quot;&gt;当前版本：v3.9.1 | 更新时间：2025-12-11 | 软件大小：85MB&lt;/p&gt;&lt;div style=&quot;display:flex;flex-wrap:wrap;justify-content:center;gap:20px;&quot;&gt;&lt;div style=&quot;flex:1;min-width:250px;max-width:300px;padding:20px;border:1px solid #eee;border-radius:8px;background-color:#f8f9fa;&quot; class=&quot;mobile-grid&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:15px;font-size:1.2rem;&quot;&gt;Windows 版本（稍后提供下载，敬请关注)&lt;/h3&gt;&lt;p style=&quot;color:#777;margin-bottom:15px;font-size:0.95rem;&quot;&gt;支持Win7/Win8/Win10/Win11 64位系统&lt;/p&gt;&lt;a href=&quot;http://www.clzwf.top/myApp/粮食收购3.9更新.zip&quot; target=&quot;_self&quot; textvalue=&quot;下载安装包&quot;&gt;下载安装包&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;!-- 常见问题 --&gt;&lt;section style=&quot;background-color: white; padding: 40px; border-radius: 8px; box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 10px; margin-bottom: 40px;&quot;&gt;&lt;h2 style=&quot;color:#2c5364;margin-bottom:25px;font-size:1.8rem;border-left:5px solid #007bff;padding-left:15px;&quot;&gt;常见问题&lt;/h2&gt;&lt;div style=&quot;margin-bottom:20px;border-bottom:1px solid #eee;padding-bottom:15px;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;Q1：软件是否免费使用？&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;A：软件提供免费试用版。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom:20px;border-bottom:1px solid #eee;padding-bottom:15px;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;Q2：安装软件需要什么配置？&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;A：Windows系统需要2GB以上内存，500MB以上硬盘空间。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom:20px;border-bottom:1px solid #eee;padding-bottom:15px;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;Q3：数据是否会上传到服务器？&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;A：软件所有数据均保存在本地设备，不会上传到任何服务器，确保数据隐私安全。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom:20px;border-bottom:1px solid #eee;padding-bottom:15px;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;Q4：如何获取软件更新？&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;A：定期访问本页面下载最新版本，更新不会丢失本地数据。&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom:none;&quot;&gt;&lt;h3 style=&quot;color:#007bff;margin-bottom:10px;font-size:1.1rem;&quot;&gt;Q5：遇到使用问题如何解决？&lt;/h3&gt;&lt;p style=&quot;color:#666;line-height:1.7;&quot;&gt;A：可查看软件内置的帮助文档，或发送邮件至clxstlk@126.com获取技术支持，我们会在24小时内回复。&lt;/p&gt;&lt;/div&gt;&lt;/section&gt;&lt;!--!doctype--&gt;</description><pubDate>Thu, 11 Dec 2025 13:45:18 +0800</pubDate></item><item><title> Delphi常用关键字用法详解</title><link>http://www.clzwf.top/?id=8</link><description>&lt;div class=&quot;editormd-toc-menu&quot;&gt;&lt;div class=&quot;markdown-toc editormd-markdown-toc&quot;&gt;[TOCM]&lt;/div&gt;&lt;/div&gt;&lt;br/&gt;&lt;p&gt;H-KING 于 2017-04-14 15&amp;#58;26&amp;#58;13 发布&lt;/p&gt;
&lt;h3 id=&quot;h3-absolute-&quot;&gt;&lt;a name=&quot;absolute：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;absolute：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-delphi&quot;&gt;//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.  
var  
 Str: string[32];  
 StrLen: Byte absoluteStr;  
//这个声明指定了变量StrLen起始地址与Str相同.  
//由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.  
begin  
Str := &amp;#39;abc&amp;#39;;  
Edit1.Text := IntToStr(StrLen);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-abstract-&quot;&gt;&lt;a name=&quot;abstract:&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;abstract:&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//它允许你创建抽象的方法, 包括有抽象方法的类称为抽象类.  
//Abstract关键字必须与Virtual或Dynamic关键字同时使用, 因为抽象方法必须被覆盖式实现.  
//抽象类不能实例化, 抽象方法不能包含方法体.  
type  
 TDemo = class  
  private  
  protected  
   procedure X; virtual; abstract;  
  public  
   constructor Create;  
   destructor Destroy; override;  
  published  
 end;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-and-&quot;&gt;&lt;a name=&quot;and：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;and：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//一、表示逻辑与  
if (a&amp;gt;0) and (b&amp;gt;0) then  
//二、表示位运算  
var  
a,b,c: Integer;  
begin  
c := (a and b);  
end;  
//使用And表示逻辑时, And左右的表达式必须用小括号括起, 以避免以生条件的冲突.  
//例如:  
if a&amp;gt;0 and b&amp;gt;0 then  
//编译器可能会理解为:  
if a&amp;gt;(0 and b)&amp;gt;0 then  
//或:  
if (a&amp;gt;0) and (b&amp;gt;0) then  
//但是实际编译时, 编译器会产生一个冲突, 报告错误.  
//并且第一种可能包含了a&amp;gt;b&amp;gt;c的形式, 这在Delphi中不被支持.  
//所以使用And运算符时必须使用括号, 以区分左右的条件.  
//表示位运算时也必须加上括号, 将And以及左右参数括起.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-array-&quot;&gt;&lt;a name=&quot;array：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;array：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Array用于表示数组, 任何的对象都能被声明成数组.数组分为静态和动态的２种.  
//静态数组  
var  
Arr1: array [1..10] of Integer;  

//动态数组, 由于声明时不知其元素个数, 所以必须在后期用SetLength方法设置数组的大小  
var  
Arr2: array of Integer;  

//数组作为参数时, 不能传入数组的大小, 只能传入数组名, 然后用Length方法获取数组的元素个数  
function X(A: array of Integer): Integer;  
var  
i: Integer;  
begin  
Result := 0;  
for i := 0 to Length(A)-1 do  
Result := Result + A[i];  
end;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-as-&quot;&gt;&lt;a name=&quot;as：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;as：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//As用于将一个对象转换为另一个对象  
procedure BtnClick(Sender:TObject);  
begin  
 (Sender as TButton).Caption := &amp;#39;Clicked&amp;#39;;  
end;  
//对于对象填充接口的转换, 必须用As进行  
(HTTPRIO as IExp).GetConnection;  

//As不能用于数据类型的转换, 下面的代码是错误的:  
var  
i: Integer;  
s: string;  
begin  
s := (i as string);  
end;  
//正确写法是:  
s := string(i);&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-asm-&quot;&gt;&lt;a name=&quot;asm：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;asm：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Asm关键字用于插入汇编代码, 使用汇编代码时, 必须使用asm...end;的结构, 而非begin...end;  
function IntToHex(Value: Integer; Digits: Integer): string;  
asm  
 CMP EDX, 32  
 JBE @A1  
 xor EDX, EDX  
 @A1: PUSH ESI  
 MOV ESI, ESP  
 SUB ESP, 32  
 PUSH ECX  
 MOV ECX, 16  
 CALL CvtInt  
 MOV EDX, ESI  
 POP EAX  
 CALL System.@LStrFromPCharLen  
 ADD ESP, 32  
 POP ESI  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-assembler-&quot;&gt;&lt;a name=&quot;assembler：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;assembler：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Assembler关键字用于支持早期的汇编, 如80386等.  
//它和Asm的区别:Asm允许使用Win32汇编, 而Assembler只允许80x86汇编, 它不允许Invoke语句的出现.  
function IntToHex(AValue: Int64): string; assembler;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-automated-&quot;&gt;&lt;a name=&quot;automated：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;automated：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Automated访问区分符用于描述一个自动类型的成员, 它能够使程序的版本向下兼容.  
//ComObj单元内的成员及其实例不能使用Automated访问区分符.  
type  
 TDemo = class  
  automated  
   Str:WideString;  
 end;  
//在程序的下一个版本中, 将Str做了修改, 变成  
type  
TDemo = class  
automated  
Str: AnsiString;  
end  
//则新版本的Str变量能够接受旧版本的WideString型数据, 并自动转换成AnsiString.  
//在实际开发中, 如果没有特殊的需要, 一般不用automated访问区分符.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-begin-&quot;&gt;&lt;a name=&quot;begin：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;begin：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//begin关键字用于表示一段程序或一个结构的开始, 必须用end关键字来结束.  
procedure X;  
begin  
 ShowMessage(&amp;#39;A Demo&amp;#39;);  
end;  
//一般的结构, 如If, For, While等也需要用begin关键字来标出结构起始点  
for i:=1 to 100 do  
begin  
sum := sum + i;  
if sum &amp;gt; 1000 then Break;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-case-&quot;&gt;&lt;a name=&quot;case：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;case：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Case语句用于完成条件选择, Case语句的的被选择对象必须是有序类型, 包括整型, 枚举类型, 字符型等.  
//Case语句必须由end结束,如果没有相符合的选择项, 可以加入else来作出通用选择.  
function GetDays(AYear,AMonth: Integer): Integer;  
begin  
 case AMonth of  
  1,3,5,7,8,10,12: Result := 31;  
  4,6,9,11: Result := 30;  
  2: begin  
  if IsLeapYear(AYear) then  
   Result:=29  
  else  
   Result:=28;  
  end;  
 else  
  Result:=0;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-cdecl-&quot;&gt;&lt;a name=&quot;cdecl：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;cdecl：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Cdecl是函数调用协定的一种, 它规定了从C或C++编写的DLL中调用函数所必须遵守的规则.  
//它可以将C或C++中的数据类型转换为Delphi的.  
//例如C++中的代码:  
int X(int i)  
{ 
 return i*2; 
}  
//这个函数被编译在Demo.dll中, 用Delphi调用时必须使用:  
function X(i: Integer): Integer; Cdecl; external &amp;#39;Demo.dll&amp;#39;;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-class-&quot;&gt;&lt;a name=&quot;class：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;class：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Class关键字用于声明或继承一个类, 也可以使类和接口同时继承.  
//另外, Class关键字也能用于声明类通用方法, 使得父类可以从类内访问子类的方法.  
type  
 ClassDemo = class(TObject)  
  private  
  public  
   constructor Create;  
 end;  
//如果用class声明方法, 则该方法在类与相关类中都可以使用, 譬如:  
type  
ClassA = class  
private  
public  
procedure Y;  
end;  

type  
ClassB = class(ClassA)  
private  
public  
class procedure X;  
end;  
//则在使用时ClassA能够直接访问ClassB的X方法  
procedure ClassA.Y;  
begin  
Self.X;  
end;  
//此时父类将子类的class方法作为自身的方法进行调用.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-const-&quot;&gt;&lt;a name=&quot;const：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;const：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Const关键字用于声明常量, 使用const声明的数据将不能在程序中被改变.  
//也可以用来声明函数参数, 用const指定的参数不允许在函数中改变.  
const MyFileName = &amp;#39;Delphi&amp;#39;;  
const MyInteger = 100;  
//用Const声明常量不需要指出其数据类型, 系统会自动判断类型, 并作自动调整.  
//函数中可以用const声明不可更改的参数  
function X(const i: Integer): string;  
//此时在函数操作过程中, i的值不可改变.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-constructor-&quot;&gt;&lt;a name=&quot;constructor：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;constructor：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//constructor关键字用来声明一个类的构造函数, 当类被实例化时, 首先调用此函数  
//构造函数一般用Create表示, Create方法能够连带类中存在的CreateWnd方法.  
type  
 ClassDemo = class(TObject)  
  private  
   fValue: Integer;  
  public  
   constructor Create;  
 end;  
constructor ClassDemo.Create;  
begin  
fValue := 0;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-contains-&quot;&gt;&lt;a name=&quot;contains：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;contains：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Contains关键字指出了某个包(Package)是否包含某个文件.  
//用Contains引入的文件必须被添加到包文件中, 它可以避免关键文件的引用丢失.  
package DATAX;  
 requires  
  rtl, clx;  
 contains  
  Db, DBLocal, DBXpress;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-default-&quot;&gt;&lt;a name=&quot;default：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;default：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Default关键字用于指出一个属性的默认值  
//只有有序类型的属性才允许默认值的存在, 否则必须在构造函数中初始化属性值.  
type  
 ClassDemo = class  
  private  
   fValue: Integer;  
  published  
   property Value: Integer read fValue write fValue default 0;  
 end;  
//它也可以指出一个类的默认属性  
property strings[Index: Integer]: string read GetString write PutString; Default;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-destructor-&quot;&gt;&lt;a name=&quot;destructor：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;destructor：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Destructor用于标识析构函数, 析构函数在类被释放时自动调用.  
//析构函数只允许覆盖, 再不允许重载.析构函数通常用Destroy作为函数名.  
type  
 ClassDemo = class(TComponent)  
  public  
   destructor Destroy;override;  
 end;  
//由于TComponent类中也有Destroy方法, 所以要将其重写  
//但是若要重载析构函数, 则不允许, 下面代码是错误的:  
destructor Destroy; overload;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-dispid-&quot;&gt;&lt;a name=&quot;dispid：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;dispid：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//DispId关键字被用在DispInterface接口中, 用于指定特定的适配序号.  
//在DispInterface接口中, 适配序号必须是唯一的,   
//如果不指定DispId, 则系统会自动分配适配序号给接口内每一个方法.  
//可以通过适配序号访问DispInterface接口中的方法.  
type  
 IStringsDisp = dispinterface  
  [&amp;#39;{EE05DFE2-5549-11D0-9EA9-0020AF3D82DA}&amp;#39;]  
  property ControlDefault[Index: Integer]: Olevariant dispid 0; default;  
  function Count: Integer; dispid 1;  
  property Item[Index: Integer]: Olevariant dispid 2;  
  procedure Remove(Index: Integer); dispid 3;  
  procedure Clear; dispid 4;  
  function Add(Item: Olevariant): Integer; dispid 5;  
  function _NewEnum: IUnknown; dispid -4;  
 end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-dispinterface-&quot;&gt;&lt;a name=&quot;dispinterface：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;dispinterface：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//DispInterface用于声明一个特定的适配器接口, 这个适配器能够接受标准系统接口中传入传出的数据.  
//用DispInterface声明的接口不能被继承, 只能够被引用.  
//DispInterface中方法只能调用, 并且必须被动态绑定.  
//可以通过DispId为接口内方汉分配适配序号.  
//DispInterface仅能用于Windows平台, 如果在Linux下进行开发, 则此关键字会自动被系统屏蔽.  
//通常情况下, 不使用DispInterface.  
//实例请参见DispId  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-div-&quot;&gt;&lt;a name=&quot;div：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;div：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Div用于求两数之整数商.用于Div运算的两个数值必须均为整型, 其运算结果也为整型.  
var  
 a,b,c:Integer;  
begin  
 a := 20; b := 3;  
 c := a div b; {6}  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-do-&quot;&gt;&lt;a name=&quot;do：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;do：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Do关键字用于For, While, On, With语句, 构成特定的结构  
//For语句:  
for i := 1 to 100 do sum:=sum+i;  

//While语句:  
while i &amp;lt; 100 do  
begin  
　sum := sum + i;  
　Inc(i);  
end;  

//On语句(异常处理):  
try  
　i := StrToInt(s);  
except  
　on exception do ShowMessage(&amp;#39;Error!&amp;#39;);  
end;  

//With语句:  
with Memo1.Lines do  
begin  
　Clear;  
　Append(&amp;#39;abc&amp;#39;);  
　Append(&amp;#39;123&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-downto-&quot;&gt;&lt;a name=&quot;downto：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;downto：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//DownTo关键字用于For语句, 指明循环变量是递减的.  
for i := 100 downto 1 do  
ListBox1.Items.Add(IntToStr(i));  
//在For语句中, 循环变量递增用To关键字, 递减用DownTo关键字.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-dynamic-&quot;&gt;&lt;a name=&quot;dynamic：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;dynamic：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Dynamic用于声明一个动态的方法,   
//动态方法可以被覆盖, 并且可以使代码大小尽可能的减少(区别于Virtual).  
procedure X(i: Integer); dynamic;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-else-&quot;&gt;&lt;a name=&quot;else：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;else：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//else用于引导程序的运行方向, 它可以与If, Case和On语句联用, 当条件不满足时, 转到else下运行  
//If语句(在If语句中, else前不允许有分号):  
if a &amp;gt; b then  
c := a  
else  
c:=b;  

//Case语句:  
case Tag Of  
1:Result:=1;  
2:Result:=2;  
3:Result:=3;  
else  
Result:=0;  
end;  

//On语句(异常处理):  
try  
i := StrToInt(s);  
Excpet  
on EZeroDivide do Result := 1;  
on EOverflow do Result := 2;  
else  
Result := 0;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-end-&quot;&gt;&lt;a name=&quot;end：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;end：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//End用于结束一个语句块或是一个单元.  
//它可以与begin, Case, Class, Interface, Asm, Unit, Package等相匹配.  
//对于语句块(局部结束), End后必须添加分号.  
//而对于单元或包(全局结束), end后必须添加句号.  
//在If语句中else关键字前的End后不允许添加符号.  
procedure X;  
begin  
　with Button1 do  
　begin  
　　if Button1.ShowHint then  
　　　Button1.Caption := &amp;#39;Hinted&amp;#39;  
　　else  
　　　Button1.Caption := &amp;#39;Not Hinted&amp;#39;;  
　end;  
end;  
//在包内使用End来结束:  
package DATAX;  
requires  
rtl,  
clx;  
contains Db, DBLocal, DBXpress;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-except-&quot;&gt;&lt;a name=&quot;except：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;except：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//except关键字用于异常处理, 必须用在try语句内, 如果发生异常, 则执行except后的语句  
try  
 i := StrToInt(s);  
except  
 ShowMessage(&amp;#39;Error!&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-export-&quot;&gt;&lt;a name=&quot;export：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;export：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Export标明了函数调用协定, 指出函数可以被输出, 输出的函数能被本地或远程调用.  
//其他程序可以用dll的形式调用程序内的函数.它是向下兼容的.  
function Add(a,b: Integer): Integer; export;  
//如果这个程序被编译为Demo.exe, 并且另一个程序需要调用这个函数, 可以使用以下语句  
function Add(a,b: Integer): Integer; stdcall; external &amp;#39;Demo.exe&amp;#39;;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-exports-&quot;&gt;&lt;a name=&quot;exports：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;exports：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//exports用于输出对象, 它必须被用在接口和实现之间, 可以同时输出多个项, 项与项之间用逗号分开.  
libraryDemo;  
function X(i: Integer): string; stdcall;  
begin  
　Result:=IntToStr(i);  
end;  

exports  
　X;  

begin  
end.  

//如果输出的对象被重载, 则必须给对象起个别名, 并注明参数.  
library Demo;  

function X(i: Integer): string; overload; stdcall;  
begin  
　Result := IntToStr(i);  
end;  

function X(s: string): Integer; overload; stdcall;  
begin  
　Result := StrToInt(s);  
end;  

exports  
X(i: Integer) name &amp;#39;x1&amp;#39;,  
X(s: string) name &amp;#39;x2&amp;#39;;  

begin  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-external-&quot;&gt;&lt;a name=&quot;external：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;external：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//External关键字用于引用一个外部的或是OBJ内的方法.  
{$L Demo.OBJ}  
procedure X(i:Integer);external;  
//如果是从dll或外部程序中引用, 则可以使用以下代码:  
function A(FileName: string): string; external &amp;#39;Demo.dll&amp;#39;;  

//如果被引用的函数被重载, 则必须另外指出引用的名称.  
function A(Name: string): string; overload; stdcall; external &amp;#39;Demo.dll&amp;#39; name &amp;#39;A1&amp;#39;;  
function A(Code: Integer): string; overload; stdcall; external &amp;#39;Demo.dll&amp;#39; name &amp;#39;A2&amp;#39;;  

//使用External关键字时, 必须注意大小写, 否则将出现错误.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-far-&quot;&gt;&lt;a name=&quot;far：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;far：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Far标明了函数调用协定, 指出函数可以被远程调用.  
//其他程序可以用dll的形式调用程序内的函数.它是向下兼容的.  
functionAdd(a,b: Integer): Integer; Far;  
//如果这个程序被编译为Demo.exe, 并且另一个处于其他计算机的程序需要调用这个函数, 可以使用以下语句:  
function Add(a,b: Integer): Integer; stdcall; external &amp;#39;Demo.exe&amp;#39;;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-file-&quot;&gt;&lt;a name=&quot;file：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;file：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//File关键字指出了文件操作类型, 文件必须被声明为File,   
//如果在File后追加Of和文件类型, 则文件可以被定义为读写指定类型数据.  
type  
 TPerson = record  
  PName: string[32];  
  PAge: Integer;  
 end;  
var  
 PFile: file of TPerson;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-finalization-&quot;&gt;&lt;a name=&quot;finalization：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;finalization：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//finalization关键字标识了单元被释放时所要调用的方法,   
//通常是释放掉单元中不能自动释放的对象, 也可以不用.  
//finalization最常用的情况是对OLE对象做反初始化.  
initialization  
 ActiveX.OleInitialize(nil);  
finalization  
 ActiveX.OleUninitialize;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-finally-&quot;&gt;&lt;a name=&quot;finally：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;finally：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//finally关键字指出了异常处理中最后必须要调用的方法,   
//不论是否发生异常, finally后的语句总是在try语句结束时执行.  
try  
 Node := Node.GetNext;  
 Edit1.Text := Node.Text;  
finally  
　Node := nil;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-for-&quot;&gt;&lt;a name=&quot;for：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;for：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//For关键字引出For循环结构, 用于做指定次数的循环.  
for i := 1 to 100 dosum := sum + i;  
//如果循环变量是递减的, 则可以用DownTo关键字  
for i := 100 downto 1 do Inc(sum);  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-forward-&quot;&gt;&lt;a name=&quot;forward：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;forward：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Forward关键字用于方法的前置定义.只定义方法声明, 然后在程序的后面对方法进行实现.  
//这么做有利于代码的可读性, 可以将所有的声明放在一起, 然后将所有的实现也放在一起.  
function X(i: Integer): Integer; forward;  
procedure Y(s: string); forward;  
...  
function X;  
begin  
 Result := i * 2;  
end;  
procedure Y;  
begin  
WriteLn(s);  
end;  

//用Forward前置声明的方法在实现时不需要再输入方法的参数和返回值, 直接使用方法名即可.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-function-&quot;&gt;&lt;a name=&quot;function：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;function：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Function用于声明函数  
functionX(i: Integer): Integer;  
//它也可以用于动态函数的声明  
type  
　TFun = function(i: Integer): Integer of object;  

//动态声明时, 不需要指出函数名, 只需要指出参数和返回类型就可以, 具体的函数名可以在后期绑定.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-goto-&quot;&gt;&lt;a name=&quot;goto：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;goto：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Goto语句用在跳转行号, 可以跳转到当前结构层内任意位置.  
//必须在声明处用label关键字声明行号.  
//由于Goto语句会破坏程序的结构, 不推荐使用.  
var  
　a,b: Integer;  
label  
　X,Y;  
begin  
　if a &amp;gt; b then  
　　goto X  
　else  
　　goto Y;  
X:  
　WriteLn(&amp;#39;a &amp;gt; b&amp;#39;);  
Y:  
　WriteLn(&amp;#39;b &amp;gt; a&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-if-&quot;&gt;&lt;a name=&quot;if：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;if：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//If关键字引出If条件语句, 用于对条件进行判断.  
var  
　a,b: Integer;  
begin  
　a := 2; b := 3;  
　if a&amp;gt;b then  
　　WriteLn(&amp;#39;a=&amp;#39; + IntToStr(a))  
　else  
　　WriteLn(&amp;#39;b=&amp;#39; + IntToStr(b));  
end;  
//If语句的通常结构是If...Then...else, else语句也可以不要.  
//在If语句内如果有多个子语句, 则必须用begin...End结构进行区分.  
if a &amp;gt; b then  
begin  
　WriteLn(&amp;#39;a&amp;gt;b&amp;#39;);  
　WriteLn(&amp;#39;a=&amp;#39; + IntToStr(a));  
　WriteLn(&amp;#39;b=&amp;#39; + IntToStr(b));  
End  
else  
　WriteLn(&amp;#39;b&amp;gt;a&amp;#39;);  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-implementation-&quot;&gt;&lt;a name=&quot;implementation：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;implementation：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Implementation标识了单元中的实现部分, 单元的基本结构为:  
//Unit...Interface...implementation...end.  
//函数体, 过程体等必须写在implementation关键字后.  
//如果在implementation后引用对象, 则对象是非公开的, 仅能供单元自身使用.  
implementation  
 uses frmAbout;  
begin  
 FormAbout.Show;  
end;  
//一个完整的单元必须拥有implementation部分.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-implements-&quot;&gt;&lt;a name=&quot;implements：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;implements：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Implements指出了一个属性从接口继承, 此时属性被转换成接口对象.  
//通过接口动态绑定属性, 并动态的设定属性值.  
type  
　IMyInterface = interface  
　　procedure P1;  
　　procedure P2;  
　end;  
　TMyImplclass = class  
　　procedure P1;  
　　procedure P2;  
　end;  
　TMyclass = class(TInterfacedObject, IMyInterface)  
　　FMyImplClass: TMyImplClass;  
　　property MyImplClass: TMyImplclass read FMyImplclass implements IMyInterface;  
　　procedure IMyInterface.P1 = MyP1;  
　　procedure MyP1;  
　end;  
//通过implements声明后, 可以在类声明时指出接口中方法的实体, 如上例中的:  
procedure IMyInterface.P1 = MyP1;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-in-&quot;&gt;&lt;a name=&quot;in：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;in：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//In用于判断一个集合中是否包含某个元素.被判断的内容必须是单个集合元素和一个集合的实例.  
type  
　TCol = (cA,cB,cC);  
　TCols = set of TCol;  
var  
　Cols: TCols;  
begin  
　Cols := [cA,cB];  
　if cA in Cols then  
　　ShowMessage(&amp;#39;cA in Cols&amp;#39;)  
　else  
　　ShowMessage(&amp;#39;cA not in Cols&amp;#39;);  
end;  
//In也用于工程文件中, 用于标识某个文件是否被工程所引用.  
Uses  
　Unit1 in &amp;#39;Unit1.pas&amp;#39;;  

//In可以被用在For语句中, 用于循环取出一个集合中的元素.  
var  
　s: string;  
　sl: TStringList;  
begin  
　...  
　for s In sl do  
　begin  
　　ShowMessage(s);  
　end;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-index-&quot;&gt;&lt;a name=&quot;index：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;index：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Index用于在属性中标识序号, 以便用相同的属性方法(Get,Set)对不同的属性进行操作.  
type  
　TForm1 = class(TForm)  
　private  
　　function GetInfo(const Index: Integer): Longint;  
　　procedure SetInfo(const Index: Integer; const Value: Longint);  
　public  
　　property iLeft:Longint index 0 read GetInfo write SetInfo;  
　　property iTop:Longint index 1 read GetInfo write SetInfo;  
　　property iWidth:Longint index 2 read GetInfo write SetInfo;  
　　property iHeight:Longint index 3 read GetInfo write SetInfo;  
　end;  
function TForm1.GetInfo(const Index: Integer): Longint;  
begin  
　case Index of  
　　0: result := self.Left;  
　　1: Result := self.Top;  
　　2: result := self.Width;  
　　3: result := self.Height;  
　end;  
end;  

//Index关键字也用于在属性中指出多个元素, 例如:  
property Selected[Index: Integer]: Boolean read GetSelected write SetSelected;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-inherited-&quot;&gt;&lt;a name=&quot;inherited：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;inherited：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Inherited用于调用父类的方法.  
type  
　TDemo = class(TComponent)  
　public  
　　constructor Create(AOwner: TComponent); override;  
　end;  
constructor TDemo.Create(AOwner: TComponent);  
begin  
　inherited Create(AOwner);  
end;  

//如果调用的是与自身同名的方法, 则也可以省去方法名和参数.如上例中的  
inherited Create(AOwner);  
//可以改成:  
Inherited;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-initialization-&quot;&gt;&lt;a name=&quot;initialization：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;initialization：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//initialization关键字标识了单元被载入时所要调用的方法,   
//通常是初始化一些不能自动初始化的对象, 也可以不用.  
//initialization最常用的情况是对OLE对象做初始化.  
initialization  
 ActiveX.OleInitialize(nil);  
finalization  
 ActiveX.OleUninitialize;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-inline-&quot;&gt;&lt;a name=&quot;inline：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;inline：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//InLine关键字用于Asm或assembler结构中,   
//用于指出该汇编语句是向下兼容的.它对于程序的编译没有任何影响.  
function IntToStr(Value: Integer): string;  
asm  
　InLine;  
 PUSH ESI  
 MOV  ESI, ESP  
 SUB  ESP, 16  
 xor  ECX, ECX  
 PUSH EDX  
 xor  EDX, EDX  
 CALL CvtInt  
 MOV  EDX, ESI  
 POP  EAX  
 CALL System.@LStrFromPCharLen  
 ADD  ESP, 16  
 POP  ESI  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-interface-&quot;&gt;&lt;a name=&quot;interface：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;interface：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Interface标识了单元中的接口部分, 单元的基本结构为:  
//Unit...Interface...implementation...end.  
//函数, 过程等的声明必须写在Interface关键字后.  
//如果在Interface后引用对象, 则对象是没有实例的, 使用时必须被实例化.  
Interface  
　uses frmAbout;  
var  
　FAbout: TFormAbout;  
begin  
　FAbout :＝ TFormAbout.Create(Self);  
　FAbout.Show;  
end;  
//一个完整的单元必须拥有Interface部分.  

//Interface也可以用作接口的声明.  
type  
　IMalloc = interface(IInterface)  
　[&amp;#39;{00000002-0000-0000-C000-000000000046}&amp;#39;]  
　　function Alloc(Size: Integer): Pointer; stdcall;  
　　function Realloc(P: Pointer; Size: Integer): Pointer; stdcall;  
　　procedure Free(P: Pointer); stdcall;  
　　function GetSize(P: Pointer): Integer; stdcall;  
　　function DidAlloc(P: Pointer): Integer; stdcall;  
　　procedure HeapMinimize; stdcall;  
　end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-is-&quot;&gt;&lt;a name=&quot;is：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;is：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Is关键字用于对象的判断, 有某些情况下, 也可以作&amp;quot;As&amp;quot;使用.  
var  
　Comp: TComponent;  
begin  
 ...  
　if Comp Is TEdit then  
　　(Comp as TEdit).Text := &amp;#39;Edit&amp;#39;;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-label-&quot;&gt;&lt;a name=&quot;label：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;label：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//label关键字用于声明行号标签, 以便用Goto进行转向, 不推荐使用.  
var  
　a,b: Integer;  
label  
　X,Y;  
begin  
　if a &amp;gt; b then  
　　goto X  
　else  
　　goto Y;  
X:  
　WriteLn(&amp;#39;a&amp;gt;b&amp;#39;);  
Y:  
　WriteLn(&amp;#39;b&amp;gt;a&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-library-&quot;&gt;&lt;a name=&quot;library：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;library：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Library关键字用于指出一个工程为类库.类库编译后生成DLL文件, 可被其他程序调用.  
library Editors;  
uses EdInit, EdInOut, EdFormat, EdPrint;  
exports  
 InitEditors,  
 doneEditors name done,  
 InsertText name Insert,  
 DeleteSelection name Delete,  
 FormatSelection,  
 PrintSelection name Print,  
 SetErrorHandler;  
begin  
 InitLibrary;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-message-&quot;&gt;&lt;a name=&quot;message：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;message：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Message关键字用于声明消息方法,   
//带有Message的方法必须指出接收的消息类型, 并通过引用将消息传入方法中, 以便进行处理.  
procedure Refresh(var Msg: TMessageRecordtype); messageID_REFRESH;  
procedure Refresh(var Msg: TMessageRecordtype);  
begin  
if Chr(Msg.Code) = #13 then  
...  
else  
inherited;  
end;  

//用户可以自定义消息, 自定义消息也能够被Message接收, 并引发事件.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-mod-&quot;&gt;&lt;a name=&quot;mod：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;mod：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Mod用于求两数之整数模, 即余数.用于Mod运算的两个数值必须均为整型, 其运算结果也为整型.  
var  
　a,b,c: Integer;  
begin  
　a := 20; b := 3;  
　c := a mod b; {2}  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-name-&quot;&gt;&lt;a name=&quot;name：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;name：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Name关键字用于指出方法的别名,   
//对于一个要被外部引用的方法, 建议用Name申请方法别名, 以避免外部程序改动方法的实体内容.  
//从外部引用一个方法时, 如果该方法有别名, 则必须用Name进行标识.  
function MessageBox(HWnd: Integer; Text, Caption: PChar; Flags: Integer): Integer;   
 stdcall; external &amp;#39;user32.dll&amp;#39; name &amp;#39;MessageBoxA&amp;#39;;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-near-&quot;&gt;&lt;a name=&quot;near：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;near：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Near标明了函数调用协定, 指出函数可以被本地调用.  
//其他程序可以用dll的形式调用程序内的函数.它是向下兼容的.  
function Add(a,b: Integer): Integer; near;  
//如果这个程序被编译为Demo.exe, 并且另一个处于本地的程序需要调用这个函数, 可以使用以下语句:  
function Add(a,b: Integer): Integer; stdcall; external &amp;#39;Demo.exe&amp;#39;;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-nil-&quot;&gt;&lt;a name=&quot;nil：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;nil：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Nil用于表示一个空指针, 或是没有实例的对象.  
while Node &amp;lt;&amp;gt; nil do  
begin  
　ListBox1.Items.Add(Node.Text);  
　Node := Node.GetNext;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-nodefault-&quot;&gt;&lt;a name=&quot;nodefault：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;nodefault：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//NoDefault关键字指出了一个属性不允许有默认值, 这通常用在继承中.  
type  
　TClassA = class  
　private  
　　fValue: Integer;  
　published  
　　property Value: Integer read fValue write fValue default 0;  
　end;  
　TClassB = class(TClassA)  
　published  
　　property Value:Integer read fValue write fValue nodefault;  
　end;  

//由上例可知, TClassA中的Value有默认值0,   
//TClassB继承了TClassA, 所以也继承了其默认值, 在此用NoDefault去掉默认值  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-not-&quot;&gt;&lt;a name=&quot;not：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;not：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Not用于取反, 它否定了原先的结果.例如:  
if a &amp;gt; b then  
//可以写成:  
if not(a &amp;lt; b) then  
//Not关键字通常用于切换Boolean型的属性  
procedure Button1Click(Sender: TObject);  
begin  
　StatusBar1.Visible := not StatusBar1.Visible;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-object-&quot;&gt;&lt;a name=&quot;object：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;object：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Object用于声明一个对象, 这个对象可以是任意的, 并且向下兼容.Object只能被Object所继承.  
//声明对象的方法与声明类的方法是相同的.  
type  
　ODemoA = object  
　end;  
　ODemoB = object(ODemoA)  
　end;  

//Object关键字还用于声明动态函数或过程, 例如:  
type  
　TMyFun = function(i: Integer): Integer of Object;  
　TMyProc = procedure(s: string) of object;  

//经过object声明的函数或过程可以被动态的绑定到指定的函数体, 或是绑定到控件是事件中.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-of-&quot;&gt;&lt;a name=&quot;of：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;of：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Of关键用于和其他关键字构成指定的结构.Of可以与Case, Class, Array, File, Set, Object连用.  
//Case语句:  
case Tag Of  
　0: Result := &amp;#39;a&amp;#39;;  
　1: Result := &amp;#39;b&amp;#39;;  
end;  

//Class语句:  
type  
　TDemo = class of TComponent;  

//Array结构:  
var  
　MyInt: array of Integer;  

//File结构:  
var  
　MyFile: file of Byte;  

//Set语句:  
type  
　TCol = (cA,cB,cC);  
　TCols = set of TCol;  

//Object结构:  
type  
　MyFun = function(I: Integer): Integer of Object;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-on-&quot;&gt;&lt;a name=&quot;on：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;on：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//On关键字用于异常处理, 指出发生的异常, 并获取异常信息.  
try  
　i := StrToInt(s);  
except  
　on E: exception do  
　　ShowMessage(E.Message);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-or-&quot;&gt;&lt;a name=&quot;or：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;or：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//一、表示逻辑或  
if (a&amp;gt;0) or (b&amp;gt;0) then  
//二、表示位运算  
var  
a,b,c: Integer;  
begin  
c := (a or b);  
end;  

//使用Or表示逻辑时, Or左右的表达式必须用小括号括起, 以避免以生条件的冲突  
//如果在条件语句中使用 Or, 则编辑器不知道用户使用Or做什么  
例如:  
if a&amp;gt;0 or b&amp;gt;0 then  
//编译器可能会理解为:  
if a&amp;gt;(0 or b)&amp;gt;0 then  
//或者  
if (a&amp;gt;0) or (b&amp;gt;0) then  
//但是实际编译时, 编译器会产生一个冲突, 报告错误  
//并且第一种可能包含了a&amp;gt;b&amp;gt;c的形式, 这在Delphi中不被支持  
//所以使用Or运算符时必须使用括号, 以区分左右的条件.  
//表示位运算时也必须加上括号, 将Or以及左右参数括起.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-out-&quot;&gt;&lt;a name=&quot;out：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;out：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Out关键字说明了方法参数的输出方式, 一般的函数只能有一个返回值,   
//使用Out可以在一个函数中返回多个结果.  
//Out和var不同, Out是以返回值的形式进行参数返回, 而var是直接输入一个参数的地址.  
procedure X(out i: Integer; out s: string);  
begin  
　i := i * 2;  
　s := s + &amp;#39;abc&amp;#39;;  
end;  
procedure TForm1.Button1Click(Sender: TObject);  
var  
　i: Integer;  
　s: string;  
begin  
　i := 20;  
　s := &amp;#39;xxx&amp;#39;;  
　X(i,s);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-overload-&quot;&gt;&lt;a name=&quot;overload：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;overload：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Overload关键字指出了用于重载的方法, 重载即方法名相同,   
//但是参数数量, 类型或顺序不同, 满足此条件的构成重载.  
function X(i: Integer): string; overload;  
function X(s: string): string; overload;  
//从父类继承时, 如果子类拥有和父类相同的方法, 则也必须用overload构成重载,   
//但是此类重载也必须满足重载的要求.  
type  
　TDemo = class(TComponent)  
　public  
　　procedure CreateWnd(AOwner: TWinControl); overload;  
　end;  

//如上例, 子类拥有的方法为:  
procedure CreateWnd; {继承自父类}  
procedure CreateWnd(AOwner: TWinControl); {子类声明}  
//共两个CreateWnd方法.  

//如果不使用重载, 则在子类中可以覆盖父类的方法.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-override-&quot;&gt;&lt;a name=&quot;override：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;override：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Override用于覆盖一个Virtual或是Dynamic形式的方法.  
//覆盖时必须沿用被覆盖方法的声明, 并且不允许修改原方法的参数和返回类型.  
procedure Create(AOwner: TComponent); override;  
//Override多用于继承, 用子类覆盖掉父类的方法.  
type  
　TClassA = class  
　　procedure X; virtual;  
　end;  

　TClassB = class(TClassA)  
　　procedure X; override;  
　end;  

//如上例, 子类拥有的方法为:  
procedure X; {从父类覆盖}  
//父类拥有的方法为:  
procedure X; {父类自身方法, 未被覆盖}  

//如果父类的方法未用Virtual或Dynamic声明,   
//或是有修改参数的需要, 则必须用Reintroduce关键字进行覆盖.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-package-&quot;&gt;&lt;a name=&quot;package：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;package：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Package关键字用于指出一个工程为控件库.  
//控件库编译后生成BPL文件, 可被安装到Delphi的控件库中, 从而在以后的开发中使用控件.  
package DATAX;  
 requires  
  rtl,  
  clx;  
 contains  
  MyUnit in &amp;#39;C:\MyProject\MyUnit.pas&amp;#39;;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-packed-&quot;&gt;&lt;a name=&quot;packed：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;packed：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Packed关键字用于对结构体记录或数组进行打包, 打包后被打包对象的体积能显著减小.  
type  
　TPerson = packed Record  
　　PName: string[32];  
　　PAge: Integer;  
　end;  
　MyArray: packed array of PChar;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-pascal-&quot;&gt;&lt;a name=&quot;pascal：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;pascal：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Pascal标明了函数调用协定,   
//指出函数在调用时遵循Pascal原因, 即先对所有的变量进行初始化,   
//避免因异步线程调用而产生的错误.它是向下兼容的.  
function X(i: Integer): Integer; Pascal;  
begin  
　Result := i * 2;  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-private-&quot;&gt;&lt;a name=&quot;private：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;private：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Private标明了类内元素的访问区分权限, 被Private区分的元素只能被本类内部访问.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-procedure-&quot;&gt;&lt;a name=&quot;procedure：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;procedure：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Procedure用于声明过程  
procedureX(i: Integer);  
//它也可以用于动态函数的声明  
type  
　TProc = procedure(i: Integer) of object;  

//动态声明时, 不需要指出过程名, 只需要指出参数就可以, 具体的过程名可以在后期绑定.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-program-&quot;&gt;&lt;a name=&quot;program：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;program：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Program关键字用于指出一个工程为应用程序.控件库编译后生成exe文件, 可以直接执行  
program Project1;  
uses  
 Forms,  
 Unit1 in &amp;#39;Unit1.pas&amp;#39; ;  
{$R *.res}  
begin  
 Application.Initialize;  
 Application.CreateForm(TForm1, Form1);  
 Application.Run;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-property-&quot;&gt;&lt;a name=&quot;property：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;property：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Property关键字用于声明属性, 属性分为显式属性和隐式属性两种,   
//只有声明在published访问区分符下的属性才是显式属性, 可以直接在对象查看器中查看.  
type  
　TDemo = class  
　Private  
　　fValue: Integr;  
　Published  
　　property Value: Integer read fValue write fValue;  
　end;  
//事件也是属性的一种, 可以在published区分符下用Property进行声明  
type  
　TOnTextChange=procedure (Sender: TObject) of object;  
　TDemo = class  
　private  
　　fEvent: TOnTexChange;  
　published  
　　property OntextChange: TOnTextChange read fEvent write fEvent;  
　end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-protected-&quot;&gt;&lt;a name=&quot;protected：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;protected：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Protected标明了类内元素的访问区分权限, 被Protected区分的元素只能被本类内部和其子类访问.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-public-&quot;&gt;&lt;a name=&quot;public：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;public：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Public标明了类内元素的访问区分权限, 被Public区分的元素能够被类内和类外任何对象访问.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-published-&quot;&gt;&lt;a name=&quot;published：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;published：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Published标明了类内元素的访问区分权限.  
//被Published区分的元素能够被类内和类外任何RTTI对象访问  
//只在声明在Published区分符下的属性才能够成为显式属性并在对象查看器中显示.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-raise-&quot;&gt;&lt;a name=&quot;raise：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;raise：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Raise语句用于抛出异常,   
//如果希望通过外部程序处理异常, 或是在异常发生时重新将异常抛出, 可以使用Raise语句.  
function GetString(i: Integer): string;  
begin  
　if i &amp;lt; 0 then  
　　raise exception.Create(&amp;#39;Integer Cannot smaller than 0&amp;#39;);  
　Result := IntToStr(i);  
end;  
//在异常处理中, 可以重新抛出异常  
try  
　i := StrToInt(s);  
except  
　on E: exception do  
　　raise exception.Create(E.Message);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-read-&quot;&gt;&lt;a name=&quot;read：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;read：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Read用于标识属性中读取所使用的成员或方法.  
private  
　fValue: Integer;  
published  
　property Value: Integer readfValue;  
//上例中即表明Value属性的值从fValue成员上读取.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-readonly-&quot;&gt;&lt;a name=&quot;readonly：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;readonly：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//ReadOnly关键字用于标识一个对象是否只读.  
propertyReadOnly;  
//当ReadOnly设为True时, 不允许用户手动修改属性, 只能通过其他对象来操作.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-record-&quot;&gt;&lt;a name=&quot;record：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;record：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Record关键字用于声明一个结构体记录,   
//一个结构体可以视为一个不需要实例化的对象, 拥有自己的成员.  
type  
　TPerson = record  
　　PName: string[32];  
　　PAge: Integer;  
　end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-register-&quot;&gt;&lt;a name=&quot;register：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;register：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Register标明了函数调用协定, 指出函数在被调用时可以在注册表内留下记录.它是向下兼容的.  
functionAdd(a,b: Integer): Integer; Register; Register  
//关键字还用于向控件库或是IDE注册控件或是专家工具.  
procedure Register;  
begin  
　RegisterComponents(&amp;#39;Sample&amp;#39;, [TDemo]);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-reintroduce-&quot;&gt;&lt;a name=&quot;reintroduce：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;reintroduce：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Reintroduce用于重新发布方法, 通常用于继承时,   
//如果要覆盖的方法是静态方法, 或是需要修改方法的参数等, 必须用Reintroduce进行重发布.  
//对于Virtual或Dynamic方法, 可以直接用Override进行覆盖.  
type  
　TClassA = class  
　　procedure X;  
　end;  
　TClassB = class(TClassA)  
　　procedure X; reintroduce;  
　end;  
　TClassC = class(TClassB)  
　　procedure X(i: Integer); reintroduce;  
　end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-repeat-&quot;&gt;&lt;a name=&quot;repeat：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;repeat：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//repeat关键字用于引出repeat循环结构,   
//该循环必须先执行一次循环体, 然后再对循环条件进行判断.repeat必须与Until关键字联合使用.  
i := 0;  
repeat  
　sum := sum + i;  
　Inc(i);  
until(i &amp;gt;= 100);  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-requires-&quot;&gt;&lt;a name=&quot;requires：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;requires：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Requires关键字指出了编译Package时的必备条件.若Requires的条件未满足, 则不允许编译包.  
package DATAX;  
 requires  
  rtl,  
  clx;  
end.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-resourcestring-&quot;&gt;&lt;a name=&quot;resourcestring：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;resourcestring：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//ResourceString用于声明资源字符串, 资源字符串可以在被声明的结构内使用.  
ResourceString  
　CreateError = &amp;#39;Cannot create file %s&amp;#39;;  
　OpenError = &amp;#39;Cannot open file %s&amp;#39;;  
　LineTooLong = &amp;#39;Line too long&amp;#39;;  
　ProductName = &amp;#39;Borland Rocks&amp;#39;;  
　SomeResourceString = SomeTrueConstant;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-safecall-&quot;&gt;&lt;a name=&quot;safecall：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;safecall：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Safecall是函数调用协定的一种, 它规定了被COM调用的函数所必须遵守和规则.  
//在编译时, Safecall声明的函数被编译成COM接口兼容的.  
procedure X(s: WideString); safecall;  
//在编译后成为:  
procedure X(s: PAnsiString);  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-set-&quot;&gt;&lt;a name=&quot;set：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;set：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Set关键字用于声明集合类, 集合类允许用集合运算符, 如in等进行操作.  
type  
　TCol = (cA,cB,cC);  
　TCols = set ofTCol;  
//操作时允许使用加减符号来添加或删除某个集合元素  
var  
　Cols: Tcols;  
begin  
　Cols := Cols + [cA,cB];  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-shl-&quot;&gt;&lt;a name=&quot;shl：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;shl：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//SHL表示向左移位, 左移的位数即乘以2的幂数  
var  
　x: Integer;  
begin  
　X := 2 shl 3; {16}  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-shr-&quot;&gt;&lt;a name=&quot;shr：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;shr：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//SHR表示向右移位, 右移的位数即除以2的幂数  
var  
　x: Integer;  
begin  
　X := 16 shr 2; {4}  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-stdcall-&quot;&gt;&lt;a name=&quot;stdcall：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;stdcall：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Stdcall是函数调用协定的一种, 它规定了能让程序调用的函数所应遵守的规则.  
//Stdcall关键字必须在主调方和被调方之间形成配对.  
//例如, 被调方函数:  
Library Demo;  
function X(i: Integer): Integer; stdcall;  
begin  
　Result := i * 2;  
end;  
exports  
　X;  
begin  
end.  

//主调方函数:  
function X(i: Integer): Integer; stdcall; external &amp;#39;Demo.dll&amp;#39;;  

//同时需要注意, 使用Stdcall关键字时, 被调函数是大小写敏感的, 此处极容易出错.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-stored-&quot;&gt;&lt;a name=&quot;stored：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;stored：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Stored用于指出一个属性的值是否能被保留, 若指定了True, 则允许对属性值进行赋值撤销的操作.  
property Value: string read fValue write fValue stored True;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-string-&quot;&gt;&lt;a name=&quot;string：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;string：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//String是一个数据类型, 它代表了字符串.  
var  
　Str: string;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-then-&quot;&gt;&lt;a name=&quot;then：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;then：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Then关键字用于If语句中, 当If条件成立时, 执行Then后的语句.  
var  
　a,b: Integer;  
begin  
　if a &amp;gt; b then  
　　WriteLn(&amp;#39;a&amp;#39;)  
　else  
　　WriteLn(&amp;#39;b&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-threadvar-&quot;&gt;&lt;a name=&quot;threadvar：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;threadvar：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Threadvar标识了一个随线程启动而创建的变量,   
//如果用Threadvar声明变量, 则在程序结束前必须手动释放其占用的空间.  
threadvar S: AnsiString;  
S := &amp;#39;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;#39;;  
S := &amp;#39;&amp;#39;;  
//S := &amp;#39;&amp;#39;; 即释放变量S所占用的内存.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-to-&quot;&gt;&lt;a name=&quot;to：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;to：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//To关键字用于For语句, 指明循环变量是递增的.  
for i := 10 to 100 do  
　ListBox1.Items.Add(IntToStr(i));  
//在For语句中, 循环变量递增用To关键字, 递减用DownTo关键字.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-try-&quot;&gt;&lt;a name=&quot;try：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;try：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//try语句用于异常处理, 对于有可能发生异常的语句, 可以放在try结构下, 以便对其进行异常保护.  
try  
　i := StrToInt(s);  
except  
　ShowMessage(&amp;#39;Error&amp;#39;);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-type-&quot;&gt;&lt;a name=&quot;type：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;type：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Type关键字用于声明各种对象, 用Type关键字声明的对象, 在传递时按引用传递.  
type  
　TDemo = class  
　end;  
//type也用来声明枚举类型或是按引用传递的变量.  
type  
　TCol = (cA,cB,cC);  
　TInt = Integer;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-unit-&quot;&gt;&lt;a name=&quot;unit：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;unit：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Unit标识了单元的开头, 单元的基本结构为 Unit...Interface...implementation...end.  
Unit Unit1;  
Interface  
　uses Classes;  
implementation  
end.  
//一个完整的单元必须拥有Unit作为开头.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-until-&quot;&gt;&lt;a name=&quot;until：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;until：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Until关键字用于判断repeat循环结构的循环条件,   
//如果循环条件为真, 则退出循环.Until必须与repeat关键字联合使用.  
i := 0;  
repeat  
　sum := sum + i;  
　Inc(i);  
until(i &amp;gt;= 100);  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-uses-&quot;&gt;&lt;a name=&quot;uses：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;uses：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Uses用于引用一个外部的单元, 并且能够使用该单元中的公共部分.  
//Uses语句通常放在一个单元的接口或是实现部分.  
Interface  
　uses Classes;  
Implemention  
　uses frmAbout;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-var-&quot;&gt;&lt;a name=&quot;var：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;var：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//var关键字用于声明一个变量或是对象, 用var声明的变量接值传递.  
var  
　i: Integer;  
　s: string;  
//var也可以用于标识按引用传递的方法参数  
function X(var i: Integer): Integer;  

//上述函数中的参数i即按引用传递, 它的值可以在函数执行时被改变, 并返回主调函数.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-varargs-&quot;&gt;&lt;a name=&quot;varargs：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;varargs：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//varArgs标识了引用参数, 它必须和Cdecl关键字联用, 表明允许调用的函数使用引用传递.  
function printf(Format: PChar): Integer; cdecl; varargs;  
//上述代码从C++的类库中引用了Printf函数, 并允许按引用的方式传入参数.  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-virtual-&quot;&gt;&lt;a name=&quot;virtual：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;virtual：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Virtual用于声明一个虚方法,   
//虚方法可以被覆盖, 并且可以使程序运行速度尽可能的快(区别于Dynamic).  
procedure X(i: Integer); virtual;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-while-&quot;&gt;&lt;a name=&quot;while：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;while：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//While关键字用于引出While循环语句, 循环前先进行循环条件的判断, 如果条件为真则执行循环.  
i := 0;  
while i &amp;lt; 100 do  
begin  
　sum := sum + i;  
　Inc(i);  
end;  &lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-with-&quot;&gt;&lt;a name=&quot;with：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;with：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//With关键字用于将相同的对象集合起来处理, 它可以省去输入大量重复的代码, 使代码看上去比较精简.  
with Form1.Memo1.Lines do  
begin  
　Clear;  
　Append(&amp;#39;abc&amp;#39;);  
　Append(&amp;#39;def&amp;#39;);  
　SaveToFile(&amp;#39;C:\demo.txt&amp;#39;);  
end;  
//上面这段代码如果不使用With语句, 则显得非常冗余复制内容到剪贴板代码:  
Form1.Memo1.Lines.Clear;  
Form1.Memo1.Lines.Append(&amp;#39;abc&amp;#39;);  
Form1.Memo1.Lines.Append(&amp;#39;def&amp;#39;);  
Form1.Memo1.Lines.SaveToFile(&amp;#39;C:\demo.txt&amp;#39;);&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-write-&quot;&gt;&lt;a name=&quot;write：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;write：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//Write用于标识属性中写入所使用的成员或方法.  
private  
　fValue: Integer;  
published  
　property Value: Integer writefValue;  
//上例中即表明Value属性的值写入到fValue成员上.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-writeonly-&quot;&gt;&lt;a name=&quot;writeonly：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;writeonly：&lt;/h3&gt;&lt;pre&gt;&lt;code class=&quot;language-pascal&quot;&gt;//writeonly关键字用于标识一个对象是否只写.  
property writeonly;  
//当writeonly设为True时, 不允许用户读取属性, 只能通过其他对象来操作.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;h3-xor-&quot;&gt;&lt;a name=&quot;xor：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;xor：&lt;/h3&gt;&lt;p&gt;&lt;code&gt;pascal  view plain  copy
//Xor用于取异或, 当两个操作数相等时, 返回False, 不等时返回True.  
var  
　a,b: Integer;  
begin  
　a := 2; b := 3;  
　if a xor b then  
　　WriteLn(&amp;#39;a xor b&amp;#39;)  
　else  
　　WriteLn(&amp;#39;a not xor b&amp;#39;);  
end;  
//Xor也用于计算异或值  
WriteLn(IntToStr(3 xor 5)); {6}&lt;/code&gt;&lt;/p&gt;
</description><pubDate>Thu, 24 Jul 2025 08:33:03 +0800</pubDate></item><item><title>lazarus 2.2.4/fpc 3.2.2修正说明</title><link>http://www.clzwf.top/?id=7</link><description>&lt;p style=&quot;padding-left: 3px; font-weight: bolder; font-size: 13px; padding-bottom: 3px; padding-top: 3px; border-bottom: 1px solid rgb(220, 220, 220); background-color: rgb(245, 245, 245); font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; white-space: normal;&quot;&gt;转自：https://www.cnblogs.com/qiufeng2014/p/16954691.html&lt;/p&gt;&lt;p style=&quot;padding-left: 3px; font-weight: bolder; font-size: 13px; padding-bottom: 3px; padding-top: 3px; border-bottom: 1px solid rgb(220, 220, 220); background-color: rgb(245, 245, 245); font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; white-space: normal;&quot;&gt;&lt;span role=&quot;heading&quot; aria-level=&quot;2&quot; style=&quot;color: #000080; text-decoration-line: none; line-height: 1.5; vertical-align: middle;&quot;&gt;&lt;a id=&quot;cb_post_title_url&quot; class=&quot;postTitle2 vertical-middle&quot; href=&quot;https://www.cnblogs.com/qiufeng2014/p/16954691.html&quot; style=&quot;color: rgb(0, 0, 128); text-decoration-line: none;&quot;&gt;lazarus 2.2.4/fpc 3.2.2修正说明&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;postText&quot; style=&quot;padding: 10px 10px 5px 3px; font-size: 13px; line-height: 1.5; margin-left: 5px; font-family: &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div id=&quot;cnblogs_post_body&quot; class=&quot;blogpost-body blogpost-body-html&quot; style=&quot;margin-bottom: 20px; word-break: break-word;&quot;&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lazarus在实际使用中还存在一些问题,特别是在linux下lazarus&lt;/strong&gt;&lt;strong&gt;代码编辑时不能输入中文/combobox/lazarus&amp;nbsp;&lt;strong&gt;Object Inspector&lt;/strong&gt;&lt;strong&gt;下拉时&lt;/strong&gt;不显示文字/日期分隔符乱码(还会引起pas文件中的中文乱码等严重的问题),如果不对fpc/lazarus进行修复,会影响开发效率和使用,经以下修改后的lazarus已能比较顺利开发应用.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;这个链接已包含以下修复内容，用解压后的文件替换原文件，重新编译fpc、lazarus就可以：&lt;a href=&quot;https://pan.baidu.com/s/1oeozSMa3-WLZ_pM5haxc1w?pwd=rcfu&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; style=&quot;color: rgb(0, 0, 128); text-decoration-line: none;&quot;&gt;https://pan.baidu.com/s/1oeozSMa3-WLZ_pM5haxc1w?pwd=rcfu&lt;/a&gt;&lt;br/&gt;提取码：rcfu&lt;br/&gt;&lt;strong&gt;一.修复lazarus中文输入&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;修改方法很简单，这4个文件开始位置添加：&lt;br/&gt;lazarus/components/synedit/lazsyngtk2imm.pas&lt;br/&gt;lazarus/lcl/interfaces/gtk2/gtk2globals.pp&lt;br/&gt;lazarus/lcl/interfaces/gtk2/gtk2widgetset.inc&lt;br/&gt;lazarus/lcl/interfaces/gtk2/gtk2proc.inc&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{$ifdef&amp;nbsp;linux}{$define&amp;nbsp;WITH_GTK2_IM}{$endif}&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;lazarus/components/synedit/synedit.inc添加&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{$ifdef&amp;nbsp;linux}{$define&amp;nbsp;Gtk2IME}{$endif}&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;二.FPC/lazrus支持中文变量/过程和函数&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;fpcsrc/compiler/scanner.pas&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;修改scanner.pas以下4个位置:&lt;/strong&gt;&lt;br/&gt;1、第4054行：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;将&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;：
修改为：&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,#$80..#255&amp;nbsp;:&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;2、第4729行：&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;将&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;c&amp;nbsp;in&amp;nbsp;[&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;,&amp;#39;_&amp;#39;]&amp;nbsp;then&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;改为：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;(c&amp;nbsp;in&amp;nbsp;[&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;,&amp;#39;_&amp;#39;,#$80..#255])&amp;nbsp;then&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;3、第4822行：&lt;br/&gt;将&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;not&amp;nbsp;(c&amp;nbsp;in&amp;nbsp;[&amp;#39;_&amp;#39;,&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;])&amp;nbsp;thenmessage2(scan_f_syn_expected,tokeninfo^[_ID].str,c);&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;改为：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;not&amp;nbsp;((c&amp;nbsp;in&amp;nbsp;[&amp;#39;_&amp;#39;,&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;,#$80..#255]))&amp;nbsp;thenmessage2(scan_f_syn_expected,tokeninfo^[_ID].str,c);&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;4、第5456行：&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;将&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;&amp;nbsp;:&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;改为：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;&amp;nbsp;,&amp;nbsp;#$80..#255:&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;修改后重新编译fpcsrc&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;修改lazarus\components\codetools\keywordfunclists.pas&lt;/strong&gt;&lt;br/&gt;将第852行：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;IsIdentChar[c]:=c&amp;nbsp;in&amp;nbsp;[&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;,&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;_&amp;#39;,&amp;#39;0&amp;#39;..&amp;#39;9&amp;#39;];&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;改为：&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;IsIdentChar[c]:=c&amp;nbsp;in&amp;nbsp;[&amp;#39;a&amp;#39;..&amp;#39;z&amp;#39;,&amp;#39;A&amp;#39;..&amp;#39;Z&amp;#39;,&amp;#39;_&amp;#39;,&amp;#39;0&amp;#39;..&amp;#39;9&amp;#39;,#$80..#255];&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;重新编译lazarus&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;三.lazarus/lcl/interfaces/gtk2:&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;1.lazarus/lcl/interfaces/gtk2/gtk2widgetset.inc:&lt;/strong&gt;&lt;br/&gt;文件开始添加以下代码:&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{$ifdef&amp;nbsp;linux}{$define&amp;nbsp;WITH_GTK2_IM}{$endif}&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;将第1386~-1393行注释&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;div class=&quot;cnblogs_code_toolbar&quot; style=&quot;margin-top: 5px;&quot;&gt;&lt;span class=&quot;cnblogs_code_copy&quot; style=&quot;line-height: 1.5; font-family: &amp;quot;Courier New&amp;quot;, serif; font-size: inherit; padding-right: 5px;&quot;&gt;&lt;a title=&quot;复制代码&quot; style=&quot;color: rgb(0, 0, 128); border: none !important;&quot;&gt;&lt;img src=&quot;https://common.cnblogs.com/images/copycode.gif&quot; alt=&quot;复制代码&quot; style=&quot;max-width: 100%; height: auto; border: none !important;&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{&amp;nbsp;//2022.07.11&amp;nbsp;LBZ&amp;nbsp;防止打开frx报表设计器出错
else
if&amp;nbsp;ALogLevel&amp;nbsp;and&amp;nbsp;G_LOG_LEVEL_CRITICAL&amp;nbsp;&amp;lt;&amp;gt;&amp;nbsp;0
then&amp;nbsp;begin
&amp;nbsp;&amp;nbsp;&amp;nbsp;Level&amp;nbsp;:=&amp;nbsp;&amp;#39;CRITICAL&amp;#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Ex&amp;nbsp;:=&amp;nbsp;EInterfaceCritical;
end}&lt;/pre&gt;&lt;div class=&quot;cnblogs_code_toolbar&quot; style=&quot;margin-top: 5px;&quot;&gt;&lt;span class=&quot;cnblogs_code_copy&quot; style=&quot;line-height: 1.5; font-family: &amp;quot;Courier New&amp;quot;, serif; font-size: inherit; padding-right: 5px;&quot;&gt;&lt;a title=&quot;复制代码&quot; style=&quot;color: rgb(0, 0, 128); border: none !important;&quot;&gt;&lt;img src=&quot;https://common.cnblogs.com/images/copycode.gif&quot; alt=&quot;复制代码&quot; style=&quot;max-width: 100%; height: auto; border: none !important;&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;2.lazarus/lcl/interfaces/gtk2/gtk2winapi.inc:&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;在第9601行添加:&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;gtk_widget_realize(PGtkWidget(GtkWindow));&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;在第9610行添加:&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;Aflags&amp;nbsp;and&amp;nbsp;GDK_WINDOW_STATE_MAXIMIZED&amp;nbsp;=&amp;nbsp;0&amp;nbsp;then//2022.10.18&amp;nbsp;LBZ&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;3.lazarus/lcl/interfaces/gtk2/gtk2wsforms.pp&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;span style=&quot;line-height: 1.5; color: #FF0000;&quot;&gt;在第409添加以下代码&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;case&amp;nbsp;ACustomForm.WindowState&amp;nbsp;of
&amp;nbsp;&amp;nbsp;wsMaximized:&amp;nbsp;gtk_window_maximize(PGtkWindow(P));
&amp;nbsp;&amp;nbsp;wsMinimized:&amp;nbsp;gtk_window_iconify(PGtkWindow(P));
&amp;nbsp;&amp;nbsp;wsFullscreen:&amp;nbsp;gtk_window_fullscreen(PGtkWindow(P));elseend;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;4.lazarus/lcl/interfaces/gtk2/gtk2devicecontext.inc&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;在第736行添加:&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;Self.BkMode:=ASource.BkMode;//2022.12.05&amp;nbsp;LBZ&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;四.lazarus/lcl/include/&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;1.修复combobox类item列表背景颜色和文字颜色相同的问题&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;lazarus/lcl/include/customcombobox.inc&lt;/strong&gt;&lt;br/&gt;&lt;span style=&quot;line-height: 1.5; color: #FF0000;&quot;&gt;第113行加上以下5行:&lt;/span&gt;&lt;br/&gt;//2022.05.28 LBZ 修复combobox类item列表背景颜色和文字颜色相同的问题&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{$ifdef&amp;nbsp;linux}//&amp;nbsp;LCLgtk2}FCanvas.FillRect(ARect);{$endif}//2022.05.28&amp;nbsp;LBZ&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;五.&lt;span style=&quot;line-height: 1.5;&quot;&gt;修复linux lazarus Object Inspector下拉列表文字颜色和背景颜色相同导致不显示的问题&lt;/span&gt;&lt;span style=&quot;line-height: 1.5; color: #FF0000;&quot;&gt;(2022.12.06 已验证lazarus 2.2.4已修复此Bug,无需按以下方法修复)&lt;/span&gt;&lt;br/&gt;&lt;/strong&gt;&lt;span style=&quot;line-height: 1.5; text-decoration-line: line-through;&quot;&gt;修复lazarus在linux(ubuntu、银河麒麟等) Object Inspector下拉文字不显示的问题。&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;line-height: 1.5; text-decoration-line: line-through;&quot;&gt;打开lazarus\components\ideintf\objectinspector.pp(3489行开始)，按红字的修改后重新编译lazarus就可以。&lt;/span&gt;&lt;br/&gt;&lt;span style=&quot;line-height: 1.5; text-decoration-line: line-through;&quot;&gt;第3517行添加以下代码:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{$ifdef&amp;nbsp;windows}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueComboBox.Canvas.Font.Color&amp;nbsp;:=&amp;nbsp;clWindowText;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{$else}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueComboBox.Canvas.Font.Color&amp;nbsp;:=&amp;nbsp;clHighlightText;//2022.5.24&amp;nbsp;LBZ&amp;nbsp;字体颜色与背景颜色相同的Bug
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{$endif}&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;六.lazarus/components&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;&lt;strong&gt;1.汉化打印对话框&lt;/strong&gt;&lt;br/&gt;lazarus/components/printers/printer4lazstrconst.pas&lt;/p&gt;&lt;div class=&quot;cnblogs_code&quot; style=&quot;background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); padding: 5px; overflow: auto; margin: 5px 0px; font-family: &amp;quot;Courier New&amp;quot; !important; font-size: 12px !important;&quot;&gt;&lt;div class=&quot;cnblogs_code_toolbar&quot; style=&quot;margin-top: 5px;&quot;&gt;&lt;span class=&quot;cnblogs_code_copy&quot; style=&quot;line-height: 1.5; font-family: &amp;quot;Courier New&amp;quot;, serif; font-size: inherit; padding-right: 5px;&quot;&gt;&lt;a title=&quot;复制代码&quot; style=&quot;color: rgb(0, 0, 128); border: none !important;&quot;&gt;&lt;img src=&quot;https://common.cnblogs.com/images/copycode.gif&quot; alt=&quot;复制代码&quot; style=&quot;max-width: 100%; height: auto; border: none !important;&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style=&quot;transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; overflow: auto; margin-top: 0px; margin-bottom: 0px; font-family: &amp;quot;Courier New&amp;quot;, serif; overflow-wrap: break-word;&quot;&gt;{*****************************************************************************
This&amp;nbsp;file&amp;nbsp;is&amp;nbsp;part&amp;nbsp;of&amp;nbsp;the&amp;nbsp;Printer4Lazarus&amp;nbsp;package

See&amp;nbsp;the&amp;nbsp;file&amp;nbsp;COPYING.modifiedLGPL.txt,&amp;nbsp;included&amp;nbsp;in&amp;nbsp;this&amp;nbsp;distribution,
for&amp;nbsp;details&amp;nbsp;about&amp;nbsp;the&amp;nbsp;license.
*****************************************************************************

Abstract:&amp;nbsp;Resourcestrings.}unit&amp;nbsp;Printer4LazStrConst;{$mode&amp;nbsp;objfpc}{$H+}interfaceresourcestringp4lrsCancel&amp;nbsp;=&amp;nbsp;&amp;#39;取消&amp;#39;;
p4lrsPrinterProperties&amp;nbsp;=&amp;nbsp;&amp;#39;打印机属性&amp;#39;;
p4lrsOk&amp;nbsp;=&amp;nbsp;&amp;#39;确定&amp;#39;;
p4lrsGeneral&amp;nbsp;=&amp;nbsp;&amp;#39;常规&amp;#39;;
p4lrsPaperSize&amp;nbsp;=&amp;nbsp;&amp;#39;纸张尺寸&amp;#39;;
p4lrsPaperType&amp;nbsp;=&amp;nbsp;&amp;#39;纸张类型&amp;#39;;
p4lrsPaperSource&amp;nbsp;=&amp;nbsp;&amp;#39;纸张来源&amp;#39;;
p4lrsResolution&amp;nbsp;=&amp;nbsp;&amp;#39;分辨率&amp;#39;;
p4lrsOrientation&amp;nbsp;=&amp;nbsp;&amp;#39;方向&amp;#39;;
p4lrsPortrait&amp;nbsp;=&amp;nbsp;&amp;#39;纵向&amp;#39;;
p4lrsLandscape&amp;nbsp;=&amp;nbsp;&amp;#39;横向&amp;#39;;
p4lrsReverseLandscape&amp;nbsp;=&amp;nbsp;&amp;#39;横向反转&amp;#39;;
p4lrsReversePortrait&amp;nbsp;=&amp;nbsp;&amp;#39;纵向反转&amp;#39;;
p4lrsBanners&amp;nbsp;=&amp;nbsp;&amp;#39;横幅(Banners)&amp;#39;;
p4lrsStart&amp;nbsp;=&amp;nbsp;&amp;#39;开始&amp;#39;;
p4lrsEnd&amp;nbsp;=&amp;nbsp;&amp;#39;结束&amp;#39;;
p4lrsPagesPerSheet&amp;nbsp;=&amp;nbsp;&amp;#39;每页页数&amp;#39;;
p4lrsMargins&amp;nbsp;=&amp;nbsp;&amp;#39;边距&amp;#39;;
p4lrsAdvanced&amp;nbsp;=&amp;nbsp;&amp;#39;高级&amp;#39;;
p4lrsNoDefaultPrinter&amp;nbsp;=&amp;nbsp;&amp;#39;未找到默认打印机.&amp;#39;;
p4lrsShortUnitsMm&amp;nbsp;=&amp;nbsp;&amp;#39;(mm)&amp;#39;;
p4lrsShortUnitsInches&amp;nbsp;=&amp;nbsp;&amp;#39;(英寸)&amp;#39;;
p4lrsButtonMoreArrow&amp;nbsp;=&amp;nbsp;&amp;#39;更多&amp;nbsp;&amp;gt;&amp;gt;&amp;#39;;
p4lrsButtonLessArrow&amp;nbsp;=&amp;nbsp;&amp;#39;&amp;lt;&amp;lt;&amp;nbsp;较少&amp;#39;;
p4lrsJobStateReady&amp;nbsp;=&amp;nbsp;&amp;#39;已准备好&amp;#39;;
p4lrsJobStatePrinting&amp;nbsp;=&amp;nbsp;&amp;#39;打印&amp;#39;;
p4lrsJobStateStopped&amp;nbsp;=&amp;nbsp;&amp;#39;停止&amp;#39;;
p4lrsJobStateAccepting&amp;nbsp;=&amp;nbsp;&amp;#39;(接受作业)&amp;#39;;
p4lrsJobStateRejecting&amp;nbsp;=&amp;nbsp;&amp;#39;(拒绝作业)&amp;#39;;
p4lrsAllPages&amp;nbsp;=&amp;nbsp;&amp;#39;全部&amp;#39;;
p4lrsPageOdd&amp;nbsp;=&amp;nbsp;&amp;#39;奇数&amp;#39;;
p4lrsPageEven&amp;nbsp;=&amp;nbsp;&amp;#39;偶数&amp;#39;;
p4lrsNotAvailable&amp;nbsp;=&amp;nbsp;&amp;#39;不可用&amp;#39;;
p4lrsAbbrevUnitsMm&amp;nbsp;=&amp;nbsp;&amp;#39;mm&amp;#39;;
p4lrsAbbrevUnitsInches&amp;nbsp;=&amp;nbsp;&amp;#39;&amp;quot;&amp;#39;;implementationend.&lt;/pre&gt;&lt;div class=&quot;cnblogs_code_toolbar&quot; style=&quot;margin-top: 5px;&quot;&gt;&lt;span class=&quot;cnblogs_code_copy&quot; style=&quot;line-height: 1.5; font-family: &amp;quot;Courier New&amp;quot;, serif; font-size: inherit; padding-right: 5px;&quot;&gt;&lt;a title=&quot;复制代码&quot; style=&quot;color: rgb(0, 0, 128); border: none !important;&quot;&gt;&lt;img src=&quot;https://common.cnblogs.com/images/copycode.gif&quot; alt=&quot;复制代码&quot; style=&quot;max-width: 100%; height: auto; border: none !important;&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;七.lazarus调整界面&lt;/p&gt;&lt;p style=&quot;line-height: 1.5; margin: 10px auto;&quot;&gt;1.lazarus/components/ide/projectwizarddlg.pas&lt;br/&gt;2.lazarus/components/ide/projectinspector.pas&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 12 Dec 2022 08:31:35 +0800</pubDate></item><item><title>delphi单元文件</title><link>http://www.clzwf.top/?id=6</link><description>&lt;h1 style=&quot;line-height: 1.25; font-size: 1.8rem; color: rgb(0, 64, 80); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;单元文件&lt;/h1&gt;&lt;p&gt;转载“&lt;span class=&quot;site-name can-hide&quot; style=&quot;outline: none; -webkit-tap-highlight-color: ; text-decoration-line: none; color: var(--textColor); display: inline-block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 1.3rem; font-weight: 600; position: relative;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/&quot; class=&quot;home-link router-link-active&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); text-decoration-line: none; color: rgb(17, 168, 205); display: inline-block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; white-space: normal;&quot;&gt;跟着老侯玩编程&lt;/a&gt;”&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;theme-vdoing-content content__default&quot; style=&quot;max-width: 860px; overflow-wrap: break-word; color: rgb(0, 64, 80); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, Cantarell, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif; font-size: 16px; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;p style=&quot;line-height: 1.7; margin-top: 2rem;&quot;&gt;写完开篇之后考虑很久先写什么，Delphi是以单元（unit）作为它的程序组成，单元文件的后缀名为&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;.pas&lt;/span&gt;&amp;nbsp;想来想去还是从单元文件开始说起&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;我们在官方文档可以看到如下的描述&lt;/p&gt;&lt;ul style=&quot;padding-left: 1.2em; line-height: 1.7;&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;将大型程序划分为可以单独编辑的模块。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;创建可以在程序之间共享的库。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;在不提供源代码的情况下将库分发给其他开发人员。&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;一个完整的，可执行的Delphi应用程序由多个单元模块组成，所有这些模块都由一个称为&lt;span style=&quot;font-weight: 600;&quot;&gt;项目文件&lt;/span&gt;的源代码模块捆绑在一起。&lt;span style=&quot;font-weight: 600;&quot;&gt;项目文件&lt;/span&gt;的后缀名为&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;.dpr&lt;/span&gt;&lt;/p&gt;&lt;blockquote style=&quot;font-size: 1rem; opacity: 0.75; border-left: 0.2rem solid rgba(100, 100, 100, 0.3); margin: 1rem 0px; padding: 0.25rem 0px 0.25rem 1rem;&quot;&gt;&lt;p style=&quot;line-height: 1.7; margin-top: 0px; margin-bottom: 0px;&quot;&gt;官方文档：http://docwiki.embarcadero.com/RADStudio/Sydney/en/Programs_and_Units_(Delphi)&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;结构和语法-dpr&quot; style=&quot;line-height: 1.25; font-size: 1.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--borderColor); margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#%E7%BB%93%E6%9E%84%E5%92%8C%E8%AF%AD%E6%B3%95-dpr&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;结构和语法-.dpr&lt;/h2&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;手动新建一个&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;VCL Application&lt;/span&gt;&amp;nbsp;通过下图的方式可以看到程序最开始的源码&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;&lt;img src=&quot;https://img-blog.csdnimg.cn/20201102094713779.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Zhcm1lcl9jaXR5,size_16,color_FFFFFF,t_70#pic_center&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;max-width: 100%;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;其代码如下：&lt;/p&gt;&lt;div class=&quot;language-pascal line-numbers-mode&quot; style=&quot;position: relative; background-color: var(--codeBg); border-radius: 6px;&quot;&gt;&lt;pre class=&quot;language-pascal codecopy-enabled&quot; style=&quot;user-select: text; line-height: 1.4; padding: 1.25rem 1.5rem 1.25rem 3.5rem; margin-top: 0.85rem; margin-bottom: 0.85rem; background-color: transparent; border-radius: 6px; overflow: auto; z-index: 1; color: rgb(0, 0, 0); text-shadow: rgb(255, 255, 255) 0px 1px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; font-size: 1em; word-spacing: normal; word-break: normal; overflow-wrap: normal; tab-size: 4; hyphens: none; vertical-align: middle; position: relative !important;&quot;&gt;program&amp;nbsp;Project1;uses
&amp;nbsp;&amp;nbsp;Vcl.Forms,
&amp;nbsp;&amp;nbsp;Unit1&amp;nbsp;in&amp;nbsp;&amp;#39;Unit1.pas&amp;#39;&amp;nbsp;{Form1};{$R&amp;nbsp;*.res}begin
&amp;nbsp;&amp;nbsp;Application.Initialize;
&amp;nbsp;&amp;nbsp;Application.MainFormOnTaskbar&amp;nbsp;:=&amp;nbsp;True;
&amp;nbsp;&amp;nbsp;Application.CreateForm(TForm1,&amp;nbsp;Form1);
&amp;nbsp;&amp;nbsp;Application.Run;end.&lt;/pre&gt;&lt;div class=&quot;line-numbers-wrapper&quot; style=&quot;position: absolute; top: 0px; width: 2.5rem; text-align: center; color: rgba(127, 127, 127, 0.5); padding: 1.25rem 0px; line-height: 1.4;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;1&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;2&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;3&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;4&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;5&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;6&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;7&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;8&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;9&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;10&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;11&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;12&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;13&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;14&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;可执行的Delphi应用程序的源代码文件包含：&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（1）&lt;span style=&quot;font-weight: 600;&quot;&gt;program&lt;/span&gt;&amp;nbsp;声明：默认情况下采用的就是当前的项目名称&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（2）&lt;span style=&quot;font-weight: 600;&quot;&gt;uses&lt;/span&gt;&amp;nbsp;语句声明：use子句由关键字use组成，后跟一个&lt;span style=&quot;font-weight: 600;&quot;&gt;逗号分隔&lt;/span&gt;的项目文件直接依赖的单位列表&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（3）可执行语句块&lt;/p&gt;&lt;div class=&quot;language-pascal line-numbers-mode&quot; style=&quot;position: relative; background-color: var(--codeBg); border-radius: 6px;&quot;&gt;&lt;pre class=&quot;language-pascal codecopy-enabled&quot; style=&quot;user-select: text; line-height: 1.4; padding: 1.25rem 1.5rem 1.25rem 3.5rem; margin-top: 0.85rem; margin-bottom: 0.85rem; background-color: transparent; border-radius: 6px; overflow: auto; z-index: 1; color: rgb(0, 0, 0); text-shadow: rgb(255, 255, 255) 0px 1px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; font-size: 1em; word-spacing: normal; word-break: normal; overflow-wrap: normal; tab-size: 4; hyphens: none; vertical-align: middle; position: relative !important;&quot;&gt;begin
&amp;nbsp;&amp;nbsp;.
&amp;nbsp;&amp;nbsp;.
&amp;nbsp;&amp;nbsp;.end.&lt;/pre&gt;&lt;div class=&quot;line-numbers-wrapper&quot; style=&quot;position: absolute; top: 0px; width: 2.5rem; text-align: center; color: rgba(127, 127, 127, 0.5); padding: 1.25rem 0px; line-height: 1.4;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;1&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;2&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;3&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;4&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;5&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;其组成语句只是对项目的Application对象的方法调用。 大多数项目都有一个全局Application变量，该变量包含Vcl.Forms.TApplication，Web.WebBroker.TWebApplication或Vcl.SvcMgr.TServiceApplication的实例（对象）。&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;该块还可以包含常量，类型，变量，过程和函数的声明； 这些声明必须在块的语句部分之前。&lt;/p&gt;&lt;blockquote style=&quot;font-size: 1rem; opacity: 0.75; border-left: 0.2rem solid rgba(100, 100, 100, 0.3); margin: 1rem 0px; padding: 0.25rem 0px 0.25rem 1rem;&quot;&gt;&lt;p style=&quot;line-height: 1.7; margin-top: 0px; margin-bottom: 0px;&quot;&gt;注意，代表程序源结尾的结尾必须后面带有英文状态句号&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;通过上文可以看出，Delphi程序确实是通过&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;.dpr&lt;/span&gt;&amp;nbsp;文件进行组织，其中&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;.pas&lt;/span&gt;&amp;nbsp;即为创建程序时通过项目创建向导并自动引入。将来自己手动创建的普通单元文件如果想成功的使用依然需要在此处进行引入&lt;/p&gt;&lt;h2 id=&quot;结构和语法-pas&quot; style=&quot;line-height: 1.25; font-size: 1.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--borderColor); margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#%E7%BB%93%E6%9E%84%E5%92%8C%E8%AF%AD%E6%B3%95-pas&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;结构和语法-.pas&lt;/h2&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;以这种后缀名结尾的文件即为普通的单元文件，这个也是使用频率最高的一种文件类型。&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;创建方式也很简单，可以通过IDE顶部菜单的**File--&amp;gt;New--&amp;gt;Unit **的方式创建，也可以通过下图的方式创建&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;&lt;img src=&quot;https://img-blog.csdnimg.cn/20201102094747776.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Zhcm1lcl9jaXR5,size_16,color_FFFFFF,t_70#pic_center&quot; alt=&quot;在这里插入图片描述&quot; style=&quot;max-width: 100%;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;一个单元由类型（包括类），常量，变量和例程（函数和过程）组成。&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;单元文件以&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;unit&amp;nbsp;开头，后跟interface&lt;/span&gt;关键字。 在&lt;span style=&quot;font-weight: 600;&quot;&gt;interface&lt;/span&gt;关键字之后，&lt;span style=&quot;font-weight: 600;&quot;&gt;uses&lt;/span&gt;子句指定了单元依赖性列表。 接下来是实现部分&lt;span style=&quot;font-weight: 600;&quot;&gt;implementation&lt;/span&gt;，然后是可选的初始化&lt;span style=&quot;font-weight: 600;&quot;&gt;initialization&lt;/span&gt;&amp;nbsp;和完成部分&lt;span style=&quot;font-weight: 600;&quot;&gt;finalization&lt;/span&gt;&amp;nbsp;。 单元源文件如下所示：&lt;/p&gt;&lt;div class=&quot;language-pascal line-numbers-mode&quot; style=&quot;position: relative; background-color: var(--codeBg); border-radius: 6px;&quot;&gt;&lt;pre class=&quot;language-pascal codecopy-enabled&quot; style=&quot;user-select: text; line-height: 1.4; padding: 1.25rem 1.5rem 1.25rem 3.5rem; margin-top: 0.85rem; margin-bottom: 0.85rem; background-color: transparent; border-radius: 6px; overflow: auto; z-index: 1; color: rgb(0, 0, 0); text-shadow: rgb(255, 255, 255) 0px 1px; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, monospace; font-size: 1em; word-spacing: normal; word-break: normal; overflow-wrap: normal; tab-size: 4; hyphens: none; vertical-align: middle; position: relative !important;&quot;&gt;unit&amp;nbsp;Unit1;interfaceuses&amp;nbsp;//&amp;nbsp;依赖清单，或者称为引入的其他单元清单，一般引入系统单元
&amp;nbsp;&amp;nbsp;//&amp;nbsp;声明部分implementationuses&amp;nbsp;//&amp;nbsp;依赖清单，或者称为引入的其他单元清单。一般引入自定义单元，可避免互相引用//&amp;nbsp;类、方法、过程和函数的实现在这里...initialization//初始化部分//&amp;nbsp;程序启动时先执行,并顺序执行。一个单元的初始化代码运行之前,就运行了它使用的每一个单元的初始化部分finalization//&amp;nbsp;结束化部分,程序结束时执行end.&lt;/pre&gt;&lt;div class=&quot;line-numbers-wrapper&quot; style=&quot;position: absolute; top: 0px; width: 2.5rem; text-align: center; color: rgba(127, 127, 127, 0.5); padding: 1.25rem 0px; line-height: 1.4;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;1&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;2&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;3&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;4&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;5&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;6&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;7&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;8&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;9&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;10&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;11&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;12&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;13&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;14&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;15&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;16&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;17&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;18&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;19&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;20&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;21&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;22&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;23&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;span class=&quot;line-number&quot; style=&quot;font-family: source-code-pro, Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; position: relative; z-index: 4; user-select: none; font-size: 0.85em;&quot;&gt;24&lt;/span&gt;&lt;br style=&quot;user-select: none;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 id=&quot;interface&quot; style=&quot;line-height: 1.25; font-size: 1.35rem; margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#interface&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;Interface&lt;/h3&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（1）接口部分声明常量、类型、变量、过程和函数,这些声明对引用单元就像自己的声明一样&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（2）在接口部分声明的过程和函数,就像使用了forward关键字(一般称为前置声明)&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（3）接口部分可以包含其自己的uses子句，该语句必须立即出现在关键字interface之后。&lt;/p&gt;&lt;h3 id=&quot;implementation&quot; style=&quot;line-height: 1.25; font-size: 1.35rem; margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#implementation&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;Implementation&lt;/h3&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（1）如果包含uses字句,必须紧跟关键字implementation&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（2）在这里实现interface中定义的过程和函数,可以任意顺序的定义和调用.&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;（3）可以定义单元私有的常量、类型(包括类)、变量、过程和函数,但这些对引用单元的客户是不可见的&lt;/p&gt;&lt;h3 id=&quot;initialization&quot; style=&quot;line-height: 1.25; font-size: 1.35rem; margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#initialization&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;Initialization&lt;/h3&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;Initialization是可选的&lt;/span&gt;。 它从保留字初始化开始，一直持续到&lt;span style=&quot;font-weight: 600;&quot;&gt;finalization&lt;/span&gt;&amp;nbsp;的开始，如果没有&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;finalization&lt;/span&gt;&amp;nbsp;部分，则一直持续到单元结束。&amp;nbsp;&lt;span style=&quot;font-weight: 600;&quot;&gt;Initialization&lt;/span&gt;&amp;nbsp;部分包含在程序启动时按照它们出现的顺序执行的语句。&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;在其他单元中引用的话单元的初始化部分将按照其在uses语句中出现的顺序执行。&lt;/p&gt;&lt;h3 id=&quot;finalization&quot; style=&quot;line-height: 1.25; font-size: 1.35rem; margin-top: -3.1rem; padding-top: 4.6rem; margin-bottom: 0px;&quot;&gt;&lt;a href=&quot;https://www.coder163.com/pages/ff91d3/#finalization&quot; class=&quot;header-anchor&quot; style=&quot;outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font-weight: 500; text-decoration-line: none; color: rgb(17, 168, 205); font-size: 0.85em; float: left; margin-left: -0.87em; padding-right: 0.23em; margin-top: 0.125em; opacity: 0;&quot;&gt;#&lt;/a&gt;Finalization&lt;/h3&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;&lt;span style=&quot;font-weight: 600;&quot;&gt;finalization部分是可选的，并且只能在具有Initialization部分的单元中使用&lt;/span&gt;。 finalization部分从保留字终结开始，一直持续到单元结束。 它包含在主程序终止时执行的语句（除非使用Halt程序终止程序）。 使用finalization部分释放在Initialization部分中分配的资源。&lt;/p&gt;&lt;p style=&quot;line-height: 1.7;&quot;&gt;finalization部分的执行顺序与Initialization部分相反。 例如，如果在应用程序以该顺序初始化单元A、B和C，它将以C、B和A的顺序完成它们的释放。&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Thu, 10 Nov 2022 08:33:37 +0800</pubDate></item><item><title>待办事项管理小工具</title><link>http://www.clzwf.top/?id=5</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap-mode: wrap;&quot;&gt;下载地址：&lt;/span&gt;&lt;a href=&quot;http://www.clzwf.top/myApp/todoList.zip&quot; style=&quot;text-wrap-mode: wrap;&quot;&gt;&amp;nbsp;todoList_1.0.zip&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;简单的待办事项管理，没有多余的功能，没有广告，绿色小巧。模仿了360桌面助手界面。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666677573515734.png&quot; alt=&quot;&quot; title=&quot;微信截图_20221025135706.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666677573934124.png&quot; alt=&quot;&quot; title=&quot;微信截图_20221025135800.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;下载地址：&lt;a href=&quot;/myApp/todoList.zip&quot;&gt; todoList_1.0.zip&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 25 Oct 2022 11:58:11 +0800</pubDate></item><item><title>诊所处方系统</title><link>http://www.clzwf.top/?id=4</link><description>&lt;p&gt;个体诊所适用的药品销售和处方系统。&lt;/p&gt;</description><pubDate>Tue, 25 Oct 2022 11:55:24 +0800</pubDate></item><item><title>粮食收购系统操作说明</title><link>http://www.clzwf.top/?id=3</link><description>&lt;h1 id=&quot;h1--v3-0-6-&quot;&gt;&lt;a name=&quot;下载地址（v3.0.6）：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;下载地址（v3.0.6）：&lt;/h1&gt;&lt;p&gt;&lt;a href=&quot;/myApp/lssg3.0.6.1_setup.zip&quot;&gt;本地下载&lt;/a&gt; &amp;nbsp;&lt;/p&gt;&lt;h1 id=&quot;h1--&quot;&gt;&lt;a name=&quot;一、概述&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;一、概述&lt;/h1&gt;&lt;p&gt;本系统主要针对中小型粮食收购企业&lt;br/&gt;1.自动读取电子秤，秤重数据自动进入计算机，防止人为更改称重数量。&lt;br/&gt;2.计算，可根据设置的单价，扣量，扣价等自动计算金额。&lt;br/&gt;3.统计，可生成日报表，汇总报表，方便掌握收购进度。&lt;/p&gt;&lt;h1 id=&quot;h1--&quot;&gt;&lt;a name=&quot;二、入库收购&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;二、入库收购&lt;/h1&gt;&lt;h2 id=&quot;h2-u4E00u822Cu7684u6536u8D2Du6D41u7A0B&quot;&gt;&lt;a name=&quot;一般的收购流程&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;一般的收购流程&lt;/h2&gt;&lt;ol class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;检质：化验员对入库粮进行检质并开出检质证（检质证的编号不可重复）。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;检毛重：对入库粮车进行毛重检斤，电脑录入相关数据。&lt;br/&gt;3.粮车进入场地卸粮，监卸员的检质证上填写掺杂扣量。&lt;br/&gt;4.检皮重：根据检质证号在电脑上调出毛检数据，对卸完粮的车进行皮重检斤。&lt;br/&gt;5.结算：电脑打印出结算单，售粮人结算卖粮款。&lt;br/&gt;&lt;strong&gt;当日收购结束后，可打印报表。&lt;br/&gt;**一个收购期结束后，可导出收购数据到历史数据文件中。&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;h2-u57FAu7840u6570u636Eu8BBEu7F6E&quot;&gt;&lt;a name=&quot;基础数据设置&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;基础数据设置&lt;/h2&gt;&lt;p&gt;点击“参数设置”，在弹出的窗口中对参数进行设置。&lt;br/&gt;一、常规&lt;br/&gt;1：单位名称&lt;br/&gt; 填写本单位名称。&lt;br/&gt;2：单位编号&lt;br/&gt; 暂时不用，为网络版预留。&lt;br/&gt;3：设置电子秤参数&lt;br/&gt; 根据实际情况设置。&lt;/p&gt;&lt;h2 id=&quot;h2--&quot;&gt;&lt;a name=&quot;二、地址信息&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;二、地址信息&lt;/h2&gt;&lt;p&gt;此处设置常用的地址名称，以方便毛重检斤时录入乡村屯数据。&lt;/p&gt;&lt;p&gt;三、车种&lt;/p&gt;&lt;p&gt;此处设置售粮人常用车种，以方便毛重检斤时录入。&lt;/p&gt;&lt;p&gt;四、参数名&lt;/p&gt;&lt;p&gt;此处设置粮食品种在检斤计算时可能用到的相关参数。常见参数系统已经设置完成，一般不用设置，如有需要请联系程序开发者。&lt;/p&gt;&lt;p&gt;五、品种&lt;/p&gt;&lt;p&gt;设置将要收购的粮食品种，可多个品种同时收购。&lt;/p&gt;&lt;p&gt;在“使用”栏标记对号的品种，将出现在检斤时的品种选择列表中。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656276116750.png&quot; alt=&quot;微信截图_20221025080303.png&quot; title=&quot;微信截图_20221025080303.png&quot;/&gt; &lt;img src alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;第一步：添加品种&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;点击“添加”按钮**&lt;/strong&gt; &lt;strong&gt;**增加收购品种。&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656465267889.png&quot; alt=&quot;&quot; title=&quot;微信截图_20221025080605.png&quot;/&gt;&lt;br/&gt;1、&lt;strong&gt;编号&lt;/strong&gt;：系统自动产生，一般不用修改。&lt;br/&gt;2、&lt;strong&gt;品名&lt;/strong&gt;：品种名称。&lt;br/&gt;3、&lt;strong&gt;定价方式&lt;/strong&gt;：手工定价和公式定价&lt;br/&gt; 手工定价是的粮食价格的检斤时，手工输入。一般是的化验员验质后确定一个结算价格，这是最灵活最简单的收购方式。&lt;br/&gt; 公式定价是根据一些固定规则，通过计算最终确定结算价格的方式。比如国家每年出台的粮食收购计价标准。具体公式设置的“编辑计算公式”中说明。&lt;br/&gt;4、&lt;strong&gt;票据&lt;/strong&gt;：粮食收购结算单的格式。详见票据格式&lt;br/&gt;5、&lt;strong&gt;等级单价设置&lt;/strong&gt;：如果定价方式是“公式定价”，此处的标准单价将公式计算结算单价的基础单价，既粮食的标准水分的各个等级单价，比如玉米在2等，水分14%时，标准单价2.04元/公斤。如果定价方式是“手工定价”，此处无意义。&lt;br/&gt;6、&lt;strong&gt;打印机&lt;/strong&gt;：暂未使用，不用设置。&lt;br/&gt;7、&lt;strong&gt;扦样加量&lt;/strong&gt;：暂未使用，不用设置。&lt;br/&gt;8、&lt;strong&gt;启用此品种&lt;/strong&gt;：勾选此项，则在检斤时，可以收购此品种，否则在检斤时此品种不可见。&lt;br/&gt;点击保存后生效。&lt;/p&gt;&lt;p&gt;第二步：选择参数&lt;/p&gt;&lt;p&gt;选中一个品种，点击“选择参数”，设置此品种的收购时要用到的参数。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656465498565.png&quot; alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;p&gt;参数分两种：输入型参数和计算型参数，输入型参数是指参数值在检斤时直接输参数值；计算型参数是指参数值需要通过公式计算而来，具体公式的“编辑计算公式”中指定。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;添加输入型参数&lt;/strong&gt;:在左侧的”可选参数”中选定一个参数,点击”添加”按钮,如果是输入型参数,就会弹出如下窗口:&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656465486724.png&quot; alt=&quot;&quot; title=&quot;微信截图_20221025080641.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、&lt;strong&gt;是否验证输入有效性&lt;/strong&gt;：勾选此项，则根据下面的最大值和最小值对输入的参数值进行检验，如果输入的值小于最小值或大于最大值，检斤数据不能保存并给出提示。&lt;br/&gt;2、&lt;strong&gt;长度&lt;/strong&gt;：指参数值的最大位数。比如等级一般是1位，水分一般是4位，位数的计算包含小数点。&lt;br/&gt;3、&lt;strong&gt;默认值&lt;/strong&gt;：检斤时没有输入参数值时，默认给出的参数值。&lt;br/&gt;&lt;strong&gt;添加计算型参数&lt;/strong&gt;：在左侧的”可选参数”中选定一个参数,点击”添加”按钮,如果是计算型参数，不会弹出任何窗口，参数名会直接出现在右侧的已选参数中。&lt;/p&gt;&lt;p&gt;第三步：编辑计算公式&lt;br/&gt;选中一个品种，点击“编辑计算公式”，设置此品种的结算金额的计算公式。&lt;br/&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656465857976.png&quot; alt=&quot;&quot; title=&quot;微信截图_20221025080658.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、可引用的数据&lt;br/&gt;公式的计算会用到一些数据,比如一车粮的等级,水分,杂质等,在公式中我们用”[ ]”扩起来的参数名标示,例如公式:水分扣量=([水分]-14)/0.5*0.65/100*[净重] ,计算时会用这车粮的实际水分 净重替换公式中的 [水分] [净重],如果粮食的水分时25%,净重5300公斤,替换后就变成:水分扣量=(25-14)/0.5*0.65/100*5300 ,计算后水分扣量是757.9公斤,由于公式的保留小数位数设置的是0，所以最后结果数758公斤。&lt;/p&gt;&lt;p&gt;可引用的数据必须是前面参数选择中已经选择的参数。另外，系统还有几个内部参数可引用&lt;br/&gt;[净重]——-毛重－皮重&lt;br/&gt;[扣后净重]————净重 － 所有扣量相加的和&lt;br/&gt;[标准单价]————品种设置中的给出的标准单价&lt;br/&gt;[结算单价]————标准单价－所有扣价相加的和&lt;br/&gt;[扣款]—————-所有扣款相加的和&lt;br/&gt;2、公式设置的例子：&lt;br/&gt;A：水分增量&lt;br/&gt;要求: 标准水分14%，每低0.5个百分点增量0.75%，但低于标准规定指标2.5个百分点及以上时，不再增量。&lt;br/&gt;公式: 水分扣量=([水分]-14)/0.5*0.75/100*[净重]&lt;br/&gt;约束: 当 水分 大于等于11.5 小于等于 14 时公式有效&lt;br/&gt;保留小数位数: 0&lt;br/&gt;B：水分扣量、扣价&lt;br/&gt;要求：标准水分14%，每高0.5个百分点扣量0.65%，并扣价0.15%作为烘干费。&lt;br/&gt;扣量公式：水分扣量=([水分]-14)/0.5*0.65/100*[净重]&lt;br/&gt;约束: 当 水分 大于等于14 小于等于 35 时公式有效&lt;br/&gt;保留小数位数: 0&lt;br/&gt;扣价公式： 水分扣价=([水分]-14)/0.5*0.15/100*[标准单价]&lt;br/&gt;约束: 当 水分 大于等于14 小于等于 35时公式有效&lt;br/&gt;保留小数位数: 3&lt;br/&gt;其他扣量：如杂质扣量，不完善粒扣量的公式设置参照水分扣量公式设置。&lt;/p&gt;&lt;p&gt;扣款设置：&lt;br/&gt;例如：卸车费= [净重]/1000*2 （每吨2元）&lt;br/&gt;默认不会在结算金额的计算时减去扣款，如果想在计算金额时减去扣款，请设置金额的公式，如：结算金额=[结算单价]*[扣后净重]－[扣款]&lt;br/&gt;金额设置：&lt;br/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666656465891994.png&quot; alt=&quot;&quot;/&gt;&lt;br/&gt;此处设置结算金额的计算公式，必须设置。&lt;br/&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;br/&gt;有3个可选项,第一第二是比较常用的公式,第三个选项是有特殊要求,需要自定义公式时用（如：结算金额=[结算单价]*[扣后净重]－[扣款] ）&lt;br/&gt;选择一个选项,点”确定”即可.&lt;br/&gt;&lt;strong&gt;收购前注意事项&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;一、设置基础数据&lt;/strong&gt;&lt;br/&gt;如前所述。&lt;br/&gt;&lt;strong&gt;二、清除无用数据&lt;/strong&gt;&lt;br/&gt;收购前，应该清除以前的无用数据。&lt;br/&gt;点击“数据维护”&lt;br/&gt; &lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666657737141838.png&quot; alt=&quot;微信截图_20221025082837.png&quot; title=&quot;微信截图_20221025082837.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、数据转历史&lt;br/&gt;将现在的收购数据转存到历史数据文件中，并自动清除数据库中的收购数据。每个收购期结束后，新的收购期开始前使用此功能。&lt;/p&gt;&lt;p&gt;历史数据将会以品种名称开头+当前日期作为文件名保存，如： 玉米2014_11_3.mdb，要查看历史数据，使用“历史数据查看器”查看。&lt;/p&gt;&lt;p&gt;2、收购数据清空&lt;br/&gt;此功能将清除数据，不保存。一般是测试系统后，使用此功能，以便清除测试数据。&lt;br/&gt;3、数据库备份&lt;br/&gt;此操作将数据库文件备份到指定目录下，以防意外。名称为”sg”加备份日期.&lt;br/&gt;4、数据库恢复&lt;/p&gt;&lt;p&gt;备份恢复，覆盖当前数据。&lt;br/&gt;&lt;strong&gt;开始收购检斤&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;点击“入库检斤”,打开入库检斤窗口：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666657807381191.png&quot; alt=&quot;微信截图_20221025082951.png&quot; title=&quot;微信截图_20221025082951.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;每项输入完成后，回车即可自动跳到下一项。&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1、检质证号&lt;/p&gt;&lt;p&gt;此项为必须输入，并且检质证号不能重复。我们以检质证号唯一确定售粮车。&lt;/p&gt;&lt;p&gt;系统根据检质证号自动判断毛重检斤和皮重检斤，在光标进入毛重或皮重项时，系统将读取电子称的数据，并等待检斤员确认。如有特殊情况需要人工输入重量时，请点击“手工方式”，&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666657890776579.png&quot; alt=&quot;微信截图_20221025083116.png&quot; title=&quot;微信截图_20221025083116.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;此时在光标进入毛重或皮重项时，会出现重量输入框。在打印结算单时，结算单上会打印手工票据的字样。&lt;/p&gt;&lt;p&gt;2、输入检质证号并按回车键&lt;/p&gt;&lt;p&gt;A：如果是毛重检斤，则弹出品种选择框&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666657927229441.png&quot; alt=&quot;微信截图_20221025083150.png&quot; title=&quot;微信截图_20221025083150.png&quot;/&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;p&gt;用上下光标键，选择品种，回车&lt;/p&gt;&lt;p&gt;下面有哪些项可输入数据，就是在参数选择时已选了哪些参数。&lt;/p&gt;&lt;p&gt;B：如果是皮重检斤，则弹出电子称的数据，并等待检斤员确认。&lt;/p&gt;&lt;p&gt;确认后光标进入“掺杂扣量”项，此处输入监卸员签的扣量数，净重=毛重-皮重-掺杂扣量&lt;/p&gt;&lt;p&gt;单价项，如果品种定价方法是公式定价，此处不能修改，如果是手工定价，此处输入单价。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666657959152877.png&quot; alt=&quot;微信截图_20221025083224.png&quot; title=&quot;微信截图_20221025083224.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;票据的修改和删除&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666667475688055.png&quot; alt=&quot;微信截图_20221025111058.png&quot; title=&quot;微信截图_20221025111058.png&quot;/&gt; &lt;/p&gt;&lt;p&gt;输入要修改或要删除的检质证号，回车或点击“搜索”,将调出此车的数据。&lt;/p&gt;&lt;p&gt;要删除票据，直接点“删除“按钮。&lt;/p&gt;&lt;p&gt;要修改票据，直接修改错误项目后，点击“重新计算”，再点“保存”。&lt;/p&gt;&lt;p&gt;毛重、皮重不能修改。该品种如果是手工定价，则单价可修改，否则单价不能修改。&lt;/p&gt;&lt;p&gt;如一定要修改这些项目，请删除此票据，重新用手工方式入库检斤（和正常入库检斤一样，也要毛检一次、皮检一次）&lt;/p&gt;&lt;p&gt;&amp;lt;div id=&amp;quot;winchm_template_content&amp;quot;&amp;gt;收购报表&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666667539913552.png&quot; alt=&quot;微信截图_20221025111203.png&quot; title=&quot;微信截图_20221025111203.png&quot;/&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;p&gt;报表分为当日报表和汇总报表两种：&lt;/p&gt;&lt;p&gt;1-单日报表：统计当天（可以用日期框指定统计哪一天）收购数量、金额、票据张数等信息。&lt;/p&gt;&lt;p&gt;2-汇总报表：统计从收购开始截止到当天（可以用日期框指定统计截止到哪一天）的收购信息。&lt;/p&gt;&lt;p&gt;点击打印可以打印报表（默认A4纸，注意更换打印机的纸张）。&lt;/p&gt;&lt;p&gt;&amp;lt;/div&amp;gt;&lt;br/&gt;二、销售出库&lt;/p&gt;&lt;p&gt;=========================================================================================&lt;/p&gt;&lt;h3 id=&quot;h3-1-&quot;&gt;&lt;a name=&quot;1、出库设置&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;1、出库设置&lt;/h3&gt;&lt;p&gt;只有一项：出库单的样式选择，具体样式详见票据格式。&lt;/p&gt;&lt;h3 id=&quot;h3-2-&quot;&gt;&lt;a name=&quot;2、往来客户&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;2、往来客户&lt;/h3&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666668943662808.png&quot; alt=&quot;微信截图_20221025113527.png&quot; title=&quot;微信截图_20221025113527.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;对有业务往来的客户进行管理。（这不是必须的，可以不设置）&lt;/p&gt;&lt;h3 id=&quot;h3-3-&quot;&gt;&lt;a name=&quot;3、出库计划&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;3、出库计划&lt;/h3&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669008899328.png&quot; alt=&quot;微信截图_20221025113635.png&quot; title=&quot;微信截图_20221025113635.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、建议发货前，编制此出库计划，出库检斤时会方便很多。&lt;/p&gt;&lt;p&gt;2、拖到底部的滚动条，会显示每个计划的完成数量。&lt;/p&gt;&lt;p&gt;3、运费计算公式可用参数：[净重]、[运价率]、[运输里程]。&lt;/p&gt;&lt;h3 id=&quot;h3-4-&quot;&gt;&lt;a name=&quot;4、运输单位&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;4、运输单位&lt;/h3&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669081580160.png&quot; alt=&quot;微信截图_20221025113748.png&quot; title=&quot;微信截图_20221025113748.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;设置运输单位和车辆信息，方便出库检斤的操作。&lt;/p&gt;&lt;h3 id=&quot;h3-5-&quot;&gt;&lt;a name=&quot;5、出库检斤&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;5、出库检斤&lt;/h3&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669169905348.png&quot; alt=&quot;微信截图_20221025113917.png&quot; title=&quot;微信截图_20221025113917.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、车号&lt;/p&gt;&lt;p&gt;如果在运输单位中设置了车辆信息，输入车号时会弹出车号选择框快速输入车号。比如在车号中输入一个5，会列出所有包含5的车号&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt;&lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669220464215.png&quot; alt=&quot;微信截图_20221025114009.png&quot; title=&quot;微信截图_20221025114009.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;按向下光标键选择车号，回车键输入完成。&lt;/p&gt;&lt;p&gt;程序根据输入的车号，自动取得承运单位、车型、司机姓名、司机电话信息（如果你在运输单位里设置了这些信息）。&lt;/p&gt;&lt;p&gt;程序会自动判断此车号是毛重检斤还是皮重检斤。&lt;/p&gt;&lt;p&gt;2、计划号&lt;/p&gt;&lt;p&gt;像输入车号一样，只要输入计划号中的一部分数字就会弹出计划列表，方便快速输入。&lt;/p&gt;&lt;p&gt;计划号输入完成后，程序自动取相关信息（如果你在出库计划中设置了这些信息）。&lt;/p&gt;&lt;p&gt;3、出货仓位是装车的货位号，便于统计某个货位发出了多少。可以不填。&lt;/p&gt;&lt;h3 id=&quot;h3-6-&quot;&gt;&lt;a name=&quot;6、出库单的修改和删除&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;6、出库单的修改和删除&lt;/h3&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669298639849.png&quot; alt=&quot;微信截图_20221025114123.png&quot; title=&quot;微信截图_20221025114123.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;修改车号和计划号时，需要输入完整的车号或计划号，然后点击后面的取得信息按钮，才能取出相关信息。&lt;/p&gt;&lt;p&gt;&lt;em&gt;出库的修改和手工检斤，不会在出库单上打印标记。可以在程序中查询那些票据修改了，那些票据是手工检斤。&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;h3-7-&quot;&gt;&lt;a name=&quot;7、出库查询&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;7、出库查询&lt;/h3&gt;&lt;p&gt;###&lt;/p&gt;&lt;p&gt;界面：&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669440835017.png&quot; alt=&quot;微信截图_20221025114347.png&quot; title=&quot;微信截图_20221025114347.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;1、筛选“手工检斤”的出库单&lt;/p&gt;&lt;p&gt;打开筛选列表，选择手工检斤，点击过滤查询。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669545703699.png&quot; alt=&quot;微信截图_20221025114529.png&quot; title=&quot;微信截图_20221025114529.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;2、筛选修改过的出库单&lt;/p&gt;&lt;p&gt;同上，选择 已修改 ，点击过滤查询。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669582447798.png&quot; alt=&quot;微信截图_20221025114606.png&quot; title=&quot;微信截图_20221025114606.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;选择一条记录，双击或点击 详细信息 按钮。会现行出此记录的详细信息和修改记录。&lt;/p&gt;&lt;p&gt;对比当前的详细信息和修改记录，可以知道每次都修改了哪些数据。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669645470801.png&quot; alt=&quot;微信截图_20221025114708.png&quot; title=&quot;微信截图_20221025114708.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;3、显示设置&lt;/p&gt;&lt;p&gt;点击显示设置按钮，可以选择查询中显示或隐藏那些列。&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669674315136.png&quot; alt=&quot;微信截图_20221025114739.png&quot; title=&quot;微信截图_20221025114739.png&quot;/&gt;&lt;/p&gt;&lt;h3 id=&quot;h3-8-&quot;&gt;&lt;a name=&quot;8、出库报表&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;8、出库报表&lt;/h3&gt;&lt;p&gt;三、单据样例&lt;/p&gt;&lt;p&gt;============================================&lt;/p&gt;&lt;p&gt;1、结算单-窄票据&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669799750823.png&quot; alt=&quot;微信截图_20221025114945.png&quot; title=&quot;微信截图_20221025114945.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;纸张：3等分 （241mm*94mm）&lt;/p&gt;&lt;p&gt;2、结算单-2等分&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669844290632.png&quot; alt=&quot;微信截图_20221025115031.png&quot; title=&quot;微信截图_20221025115031.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;纸张：2等分 （241mm*140mm）&lt;/p&gt;&lt;p&gt;3、出库单-3等分&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669879661521.png&quot; alt=&quot;微信截图_20221025115102.png&quot; title=&quot;微信截图_20221025115102.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;4、出库单-2等分&lt;/p&gt;&lt;p&gt;&lt;img src alt=&quot;&quot;/&gt; &lt;img src=&quot;http://www.clzwf.top/zb_users/upload/2022/10/202210251666669910575391.png&quot; alt=&quot;微信截图_20221025115137.png&quot; title=&quot;微信截图_20221025115137.png&quot;/&gt;&lt;/p&gt;&lt;h1 id=&quot;h1--v3-0-6-&quot;&gt;&lt;a name=&quot;四、下载地址（v3.0.6）：&quot; class=&quot;reference-link&quot; href=&quot;#&quot;&gt;&lt;/a&gt;&lt;span class=&quot;header-link octicon octicon-link&quot;&gt;&lt;/span&gt;四、下载地址（v3.0.6）：&lt;/h1&gt;&lt;p&gt;&lt;a href=&quot;/myApp/lssg3.0.6.1_setup.zip&quot;&gt;本地下载&lt;/a&gt; &amp;nbsp;&lt;/p&gt;&lt;p&gt;=======================================&lt;/p&gt;&lt;p&gt;注意：软件是个人开发，杀毒软件会报毒，请自行添加到杀软的信任列表中。&lt;/p&gt;</description><pubDate>Mon, 24 Oct 2022 15:56:35 +0800</pubDate></item><item><title>欢迎到来</title><link>http://www.clzwf.top/?id=1</link><description>&lt;p&gt;祝您使用愉快！&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 24 Oct 2022 15:51:24 +0800</pubDate></item></channel></rss>