导航:首页 > 知识产权 > delphi版权符号

delphi版权符号

发布时间:2021-07-20 02:45:53

Ⅰ 谁给我来点计算机的参考文献啊

正则表达式基础知识

一个正则表达式就是由普通字符(例如字符 a 到 z)以及特殊字符(称为元字符)组成的文字模式。该模式描述在查找文字主体时待匹配的一个或多个字符串。正则表达式作为一个模板,将某个字符模式与所搜索的字符串进行匹配。如:
JScript VBScript 匹配
/^\[ \t]*$/ "^\[ \t]*$" 匹配一个空白行。
/\d{2}-\d{5}/ "\d{2}-\d{5}" 验证一个ID 号码是否由一个2位数字,一个连字符以及一个5位数字组成。
/<(.*)>.*<\/\1>/ "<(.*)>.*<\/\1>" 匹配一个 HTML 标记。

下表是元字符及其在正则表达式上下文中的行为的一个完整列表:
字符 描述
\ 将下一个字符标记为一个特殊字符、或一个原义字符、或一个 向后引用、或一个八进制转义符。例如,'n' 匹配字符 "n"。'\n' 匹配一个换行符。序列 '\\' 匹配 "\" 而 "\(" 则匹配 "("。
^ 匹配输入字符串的开始位置。如果设置了 RegExp 对象的 Multiline 属性,^ 也匹配 '\n' 或 '\r' 之后的位置。
$ 匹配输入字符串的结束位置。如果设置了RegExp 对象的 Multiline 属性,$ 也匹配 '\n' 或 '\r' 之前的位置。
* 匹配前面的子表达式零次或多次。例如,zo* 能匹配 "z" 以及 "zoo"。* 等价于{0,}。
+ 匹配前面的子表达式一次或多次。例如,'zo+' 能匹配 "zo" 以及 "zoo",但不能匹配 "z"。+ 等价于 {1,}。
? 匹配前面的子表达式零次或一次。例如,"do(es)?" 可以匹配 "do" 或 "does" 中的"do" 。? 等价于 {0,1}。
{n} n 是一个非负整数。匹配确定的 n 次。例如,'o{2}' 不能匹配 "Bob" 中的 'o',但是能匹配 "food" 中的两个 o。
{n,} n 是一个非负整数。至少匹配n 次。例如,'o{2,}' 不能匹配 "Bob" 中的 'o',但能匹配 "foooood" 中的所有 o。'o{1,}' 等价于 'o+'。'o{0,}' 则等价于 'o*'。
{n,m} m 和 n 均为非负整数,其中n <= m。最少匹配 n 次且最多匹配 m 次。例如,"o{1,3}" 将匹配 "fooooood" 中的前三个 o。'o{0,1}' 等价于 'o?'。请注意在逗号和两个数之间不能有空格。
? 当该字符紧跟在任何一个其他限制符 (*, +, ?, {n}, {n,}, {n,m}) 后面时,匹配模式是非贪婪的。非贪婪模式尽可能少的匹配所搜索的字符串,而默认的贪婪模式则尽可能多的匹配所搜索的字符串。例如,对于字符串 "oooo",'o+?' 将匹配单个 "o",而 'o+' 将匹配所有 'o'。
. 匹配除 "\n" 之外的任何单个字符。要匹配包括 '\n' 在内的任何字符,请使用象 '[.\n]' 的模式。
(pattern) 匹配 pattern 并获取这一匹配。所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches 集合,在JScript 中则使用 $0…$9 属性。要匹配圆括号字符,请使用 '\(' 或 '\)'。
(?:pattern) 匹配 pattern 但不获取匹配结果,也就是说这是一个非获取匹配,不进行存储供以后使用。这在使用 "或" 字符 (|) 来组合一个模式的各个部分是很有用。例如, 'instr(?:y|ies) 就是一个比 'instry|instries' 更简略的表达式。
(?=pattern) 正向预查,在任何匹配 pattern 的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不需要获取供以后使用。例如,'Windows (?=95|98|NT|2000)' 能匹配 "Windows 2000" 中的 "Windows" ,但不能匹配 "Windows 3.1" 中的 "Windows"。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的搜索,而不是从包含预查的字符之后开始。
(?!pattern) 负向预查,在任何不匹配 pattern 的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不需要获取供以后使用。例如'Windows (?!95|98|NT|2000)' 能匹配 "Windows 3.1" 中的 "Windows",但不能匹配 "Windows 2000" 中的 "Windows"。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的搜索,而不是从包含预查的字符之后开始
x|y 匹配 x 或 y。例如,'z|food' 能匹配 "z" 或 "food"。'(z|f)ood' 则匹配 "zood" 或 "food"。
[xyz] 字符集合。匹配所包含的任意一个字符。例如, '[abc]' 可以匹配 "plain" 中的 'a'。
[^xyz] 负值字符集合。匹配未包含的任意字符。例如, '[^abc]' 可以匹配 "plain" 中的'p'。
[a-z] 字符范围。匹配指定范围内的任意字符。例如,'[a-z]' 可以匹配 'a' 到 'z' 范围内的任意小写字母字符。
[^a-z] 负值字符范围。匹配任何不在指定范围内的任意字符。例如,'[^a-z]' 可以匹配任何不在 'a' 到 'z' 范围内的任意字符。
\b 匹配一个单词边界,也就是指单词和空格间的位置。例如, 'er\b' 可以匹配"never" 中的 'er',但不能匹配 "verb" 中的 'er'。
\B 匹配非单词边界。'er\B' 能匹配 "verb" 中的 'er',但不能匹配 "never" 中的 'er'。
\cx 匹配由 x 指明的控制字符。例如, \cM 匹配一个 Control-M 或回车符。x 的值必须为 A-Z 或 a-z 之一。否则,将 c 视为一个原义的 'c' 字符。
\d 匹配一个数字字符。等价于 [0-9]。
\D 匹配一个非数字字符。等价于 [^0-9]。
\f 匹配一个换页符。等价于 \x0c 和 \cL。
\n 匹配一个换行符。等价于 \x0a 和 \cJ。
\r 匹配一个回车符。等价于 \x0d 和 \cM。
\s 匹配任何空白字符,包括空格、制表符、换页符等等。等价于 [ \f\n\r\t\v]。
\S 匹配任何非空白字符。等价于 [^ \f\n\r\t\v]。
\t 匹配一个制表符。等价于 \x09 和 \cI。
\v 匹配一个垂直制表符。等价于 \x0b 和 \cK。
\w 匹配包括下划线的任何单词字符。等价于'[A-Za-z0-9_]'。
\W 匹配任何非单词字符。等价于 '[^A-Za-z0-9_]'。
\xn 匹配 n,其中 n 为十六进制转义值。十六进制转义值必须为确定的两个数字长。例如,'\x41' 匹配 "A"。'\x041' 则等价于 '\x04' & "1"。正则表达式中可以使用 ASCII 编码。.
\num 匹配 num,其中 num 是一个正整数。对所获取的匹配的引用。例如,'(.)\1' 匹配两个连续的相同字符。
\n 标识一个八进制转义值或一个向后引用。如果 \n 之前至少 n 个获取的子表达式,则 n 为向后引用。否则,如果 n 为八进制数字 (0-7),则 n 为一个八进制转义值。
\nm 标识一个八进制转义值或一个向后引用。如果 \nm 之前至少有 nm 个获得子表达式,则 nm 为向后引用。如果 \nm 之前至少有 n 个获取,则 n 为一个后跟文字 m 的向后引用。如果前面的条件都不满足,若 n 和 m 均为八进制数字 (0-7),则 \nm 将匹配八进制转义值 nm。
\nml 如果 n 为八进制数字 (0-3),且 m 和 l 均为八进制数字 (0-7),则匹配八进制转义值 nml。
\un 匹配 n,其中 n 是一个用四个十六进制数字表示的 Unicode 字符。例如, \u00A9 匹配版权符号 (&;)。

下面看几个例子:
"^The":表示所有以"The"开始的字符串("There","The cat"等);
"of despair$":表示所以以"of despair"结尾的字符串;
"^abc$":表示开始和结尾都是"abc"的字符串——呵呵,只有"abc"自己了;
"notice":表示任何包含"notice"的字符串。

'*','+'和'?'这三个符号,表示一个或一序列字符重复出现的次数。它们分别表示“没有或
更多”,“一次或更多”还有“没有或一次”。下面是几个例子:
"ab*":表示一个字符串有一个a后面跟着零个或若干个b。("a", "ab", "abbb",……);
"ab+":表示一个字符串有一个a后面跟着至少一个b或者更多;
"ab?":表示一个字符串有一个a后面跟着零个或者一个b;
"a?b+$":表示在字符串的末尾有零个或一个a跟着一个或几个b。
也可以使用范围,用大括号括起,用以表示重复次数的范围。
"ab{2}":表示一个字符串有一个a跟着2个b("abb");
"ab{2,}":表示一个字符串有一个a跟着至少2个b;
"ab{3,5}":表示一个字符串有一个a跟着3到5个b。
请注意,你必须指定范围的下限(如:"{0,2}"而不是"{,2}")。还有,你可能注意到了,'*','+'和
'?'相当于"{0,}","{1,}"和"{0,1}"。
还有一个'¦',表示“或”操作:
"hi¦hello":表示一个字符串里有"hi"或者"hello";
"(b¦cd)ef":表示"bef"或"cdef";
"(a¦b)*c":表示一串"a""b"混合的字符串后面跟一个"c";
'.'可以替代任何字符:
"a.[0-9]":表示一个字符串有一个"a"后面跟着一个任意字符和一个数字;
"^.{3}$":表示有任意三个字符的字符串(长度为3个字符);
方括号表示某些字符允许在一个字符串中的某一特定位置出现:
"[ab]":表示一个字符串有一个"a"或"b"(相当于"a¦b");
"[a-d]":表示一个字符串包含小写的'a'到'd'中的一个(相当于"a¦b¦c¦d"或者"[abcd]");
"^[a-zA-Z]":表示一个以字母开头的字符串;
"[0-9]%":表示一个百分号前有一位的数字;
",[a-zA-Z0-9]$":表示一个字符串以一个逗号后面跟着一个字母或数字结束。
你也可以在方括号里用'^'表示不希望出现的字符,'^'应在方括号里的第一位。(如:"%[^a-zA-Z]%"表
示两个百分号中不应该出现字母)。
为了逐字表达,必须在"^.$()¦*+?{\"这些字符前加上转移字符'\'。
请注意在方括号中,不需要转义字符。

五种常见的 PHP 设计模式

设计模式只是为 Java™ 架构师准备的 —— 至少您可能一直这样认为。实际上,设计模式对于每个人都非常有用。如果这些工具不是 “架构太空人” 的专利,那么它们又是什么?为什么说它们在 PHP 应用程序中非常有用?本文解释了这些问题。
设计模式 一书将设计模式引入软件社区,该书的作者是 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides Design(俗称 “四人帮”)。所介绍的设计模式背后的核心概念非常简单。经过多年的软件开发实践,Gamma 等人发现了某些具有固定设计的模式,就像建筑师设计房子和建筑物一样,可以为浴室的位置或厨房的构造方式开发模板。使用这些模板或者说设计模式 意味着可以更快地设计更好的建筑物。同样的概念也适用于软件。
设计模式不仅代表着更快开发健壮软件的有用方法,而且还提供了以友好的术语封装大型理念的方法。例如,您可以说您正在编写一个提供松散耦合的消息传递系统,也可以说你正在编写名称为观察者 的模式。
用较小的示例展示模式的价值是非常困难的。这往往有些大材小用的意味,因为模式实际上是在大型代码库中发挥作用的。本文不展示大型应用程序,所以您 需要思索的是在您自己的大型应用程序中应用示例原理的方法 —— 而不是本文演示的代码本身。这不是说您不应该在小应用程序中使用模式。很多良好的应用程序都以小应用程序为起点,逐渐发展到大型应用程序,所以没有理由不 以此类扎实的编码实践为基础。
既然您已经了解了设计模式以及它们的有用之处,现在我们来看看 PHP V5 的五种常用模式。
工厂模式
最初在设计模式 一书中,许多设计模式都鼓励使用松散耦合。要理解这个概念,让我们最好谈一下许多开发人员从事大型系统的艰苦历程。在更改一个代码片段时,就会发生问题,系统其他部分 —— 您曾认为完全不相关的部分中也有可能出现级联破坏。
该问题在于紧密耦合 。系统某个部分中的函数和类严重依赖于系统的其他部分中函数和类的行为和结构。您需要一组模式,使这些类能够相互通信,但不希望将它们紧密绑定在一起,以避免出现联锁。
在大型系统中,许多代码依赖于少数几个关键类。需要更改这些类时,可能会出现困难。例如,假设您有一个从文件读取的 User 类。您希望将其更改为从数据库读取的其他类,但是,所有的代码都引用从文件读取的原始类。这时候,使用工厂模式会很方便。
工厂模式 是一种类,它具有为您创建对象的某些方法。您可以使用工厂类创建对象,而不直接使用 new。这样,如果您想要更改所创建的对象类型,只需更改该工厂即可。使用该工厂的所有代码会自动更改。
清单 1 显示工厂类的一个示列。等式的服务器端包括两个部分:数据库和一组 PHP 页面,这些页面允许您添加反馈、请求反馈列表并获取与特定反馈相关的文章。

清单 1. Factory1.php
<?php
interface IUser
{
function getName();
}

class User implements IUser
{
public function __construct( $id ) { }

public function getName()
{
return "Jack";
}
}

class UserFactory
{
public static function Create( $id )
{
return new User( $id );
}
}

$uo = UserFactory::Create( 1 );
echo( $uo->getName()."\n" );
?>

IUser 接口定义用户对象应执行什么操作。IUser 的实现称为 User,UserFactory 工厂类则创建 IUser 对象。此关系可以用图 1 中的 UML 表示。

图 1. 工厂类及其相关 IUser 接口和用户类

如果您使用 php 解释器在命令行上运行此代码,将得到如下结果:
% php factory1.php
Jack
%

测试代码会向工厂请求 User 对象,并输出 getName 方法的结果。
有一种工厂模式的变体使用工厂方法。类中的这些公共静态方法构造该类型的对象。如果创建此类型的对象非常重要,此方法非常有用。例如,假设您需要先 创建对象,然后设置许多属性。此版本的工厂模式会将该进程封装在单个位置中,这样,不用复制复杂的初始化代码,也不必将复制好的代码在在代码库中到处粘 贴。
清单 2 显示使用工厂方法的一个示例。

清单 2. Factory2.php
<?php
interface IUser
{
function getName();
}

class User implements IUser
{
public static function Load( $id )
{
return new User( $id );
}

public static function Create( )
{
return new User( null );
}

public function __construct( $id ) { }

public function getName()
{
return "Jack";
}
}

$uo = User::Load( 1 );
echo( $uo->getName()."\n" );
?>

这段代码要简单得多。它仅有一个接口 IUser 和一个实现此接口的 User 类。User 类有两个创建对象的静态方法。此关系可用图 2 中的 UML 表示。

图 2. IUser 接口和带有工厂方法的 user 类

在命令行中运行脚本产生的结果与清单 1 的结果相同,如下所示:
% php factory2.php
Jack
%

如上所述,有时此类模式在规模较小的环境中似乎有些大材小用。不过,最好还是学习这种扎实的编码形式,以便应用于任意规模的项目中。
单元素模式
某些应用程序资源是独占的,因为有且只有一个此类型的资源。例如,通过数据库句柄到数据库的连接是独占的。您希望在应用程序中共享数据库句柄,因为在保持连接打开或关闭时,它是一种开销,在获取单个页面的过程中更是如此。
单元素模式可以满足此要求。如果应用程序每次包含且仅包含一个对象,那么这个对象就是一个单元素(Singleton)。清单 3 中的代码显示了 PHP V5 中的一个数据库连接单元素。

清单 3. Singleton.php
<?php
require_once("DB.php");

class DatabaseConnection
{
public static function get()
{
static $db = null;
if ( $db == null )
$db = new DatabaseConnection();
return $db;
}

private $_handle = null;

private function __construct()
{
$dsn = 'mysql://root:password@localhost/photos';
$this->_handle =& DB::Connect( $dsn, array() );
}

public function handle()
{
return $this->_handle;
}
}

print( "Handle = ".DatabaseConnection::get()->handle()."\n" );
print( "Handle = ".DatabaseConnection::get()->handle()."\n" );
?>

此代码显示名为 DatabaseConnection 的单个类。您不能创建自已的 DatabaseConnection,因为构造函数是专用的。但使用静态 get 方法,您可以获得且仅获得一个 DatabaseConnection 对象。此代码的 UML 如图 3 所示。

图 3. 数据库连接单元素

在两次调用间,handle 方法返回的数据库句柄是相同的,这就是最好的证明。您可以在命令行中运行代码来观察这一点。
% php singleton.php
Handle = Object id #3
Handle = Object id #3
%

返回的两个句柄是同一对象。如果您在整个应用程序中使用数据库连接单元素,那么就可以在任何地方重用同一句柄。
您可以使用全局变量存储数据库句柄,但是,该方法仅适用于较小的应用程序。在较大的应用程序中,应避免使用全局变量,并使用对象和方法访问资源。
观察者模式
观察者模式为您提供了避免组件之间紧密耦合的另一种方法。该模式非常简单:一个对象通过添加一个方法(该方法允许另一个对象,即观察者 注册自己)使本身变得可观察。当可观察的对象更改时,它会将消息发送到已注册的观察者。这些观察者使用该信息执行的操作与可观察的对象无关。结果是对象可以相互对话,而不必了解原因。
一个简单示例是系统中的用户列表。清单 4 中的代码显示一个用户列表,添加用户时,它将发送出一条消息。添加用户时,通过发送消息的日志观察者可以观察此列表。

清单 4. Observer.php
<?php
interface IObserver
{
function onChanged( $sender, $args );
}

interface IObservable
{
function addObserver( $observer );
}

class UserList implements IObservable
{
private $_observers = array();

public function addCustomer( $name )
{
foreach( $this->_observers as $obs )
$obs->onChanged( $this, $name );
}

public function addObserver( $observer )
{
$this->_observers []= $observer;
}
}

class UserListLogger implements IObserver
{
public function onChanged( $sender, $args )
{
echo( "'$args' added to user list\n" );
}
}

$ul = new UserList();
$ul->addObserver( new UserListLogger() );
$ul->addCustomer( "Jack" );
?>

此代码定义四个元素:两个接口和两个类。IObservable 接口定义可以被观察的对象,UserList 实现该接口,以便将本身注册为可观察。IObserver 列表定义要通过怎样的方法才能成为观察者,UserListLogger 实现 IObserver 接口。图 4 的 UML 中展示了这些元素。

图 4. 可观察的用户列表和用户列表事件日志程序

如果在命令行中运行它,您将看到以下输出:
% php observer.php
'Jack' added to user list
%

测试代码创建 UserList,并将 UserListLogger 观察者添加到其中。然后添加一个消费者,并将这一更改通知 UserListLogger。
认识到 UserList 不知道日志程序将执行什么操作很关键。可能存在一个或多个执行其他操作的侦听程序。例如,您可能有一个向新用户发送消息的观察者,欢迎新用户使用该系统。这种方法的价值在于 UserList 忽略所有依赖它的对象,它主要关注在列表更改时维护用户列表并发送消息这一工作。
此模式不限于内存中的对象。它是在较大的应用程序中使用的数据库驱动的消息查询系统的基础。
命令链模式
命令链 模式以松散耦合主题为基础,发送消息、命令和请求,或通过一组处理程序发送任意内容。每个处理程序都会自行判断自己能否处理请求。如果可以,该请求被处理,进程停止。您可以为系统添加或移除处理程序,而不影响其他处理程序。清单 5 显示了此模式的一个示例。

清单 5. Chain.php
<?php
interface ICommand
{
function onCommand( $name, $args );
}

class CommandChain
{
private $_commands = array();

public function addCommand( $cmd )
{
$this->_commands []= $cmd;
}

public function runCommand( $name, $args )
{
foreach( $this->_commands as $cmd )
{
if ( $cmd->onCommand( $name, $args ) )
return;
}
}
}

class UserCommand implements ICommand
{
public function onCommand( $name, $args )
{
if ( $name != 'addUser' ) return false;
echo( "UserCommand handling 'addUser'\n" );
return true;
}
}

class MailCommand implements ICommand
{
public function onCommand( $name, $args )
{
if ( $name != 'mail' ) return false;
echo( "MailCommand handling 'mail'\n" );
return true;
}
}

$cc = new CommandChain();
$cc->addCommand( new UserCommand() );
$cc->addCommand( new MailCommand() );
$cc->runCommand( 'addUser', null );
$cc->runCommand( 'mail', null );
?>

此代码定义维护 ICommand 对象列表的 CommandChain 类。两个类都可以实现 ICommand 接口 —— 一个对邮件的请求作出响应,另一个对添加用户作出响应。 图 5 给出了 UML。

图 5. 命令链及其相关命令

如果您运行包含某些测试代码的脚本,则会得到以下输出:
% php chain.php
UserCommand handling 'addUser'
MailCommand handling 'mail'
%

代码首先创建 CommandChain 对象,并为它添加两个命令对象的实例。然后运行两个命令以查看谁对这些命令作出了响应。如果命令的名称匹配 UserCommand 或 MailCommand,则代码失败,不发生任何操作。
为处理请求而创建可扩展的架构时,命令链模式很有价值,使用它可以解决许多问题。
策略模式
我们讲述的最后一个设计模式是策略 模式。在此模式中,算法是从复杂类提取的,因而可以方便地替换。例如,如果要更改搜索引擎中排列页的方法,则策略模式是一个不错的选择。思考一下搜索引擎 的几个部分 —— 一部分遍历页面,一部分对每页排列,另一部分基于排列的结果排序。在复杂的示例中,这些部分都在同一个类中。通过使用策略模式,您可将排列部分放入另一个 类中,以便更改页排列的方式,而不影响搜索引擎的其余代码。
作为一个较简单的示例,清单 6 显示了一个用户列表类,它提供了一个根据一组即插即用的策略查找一组用户的方法。

清单 6. Strategy.php
<?php
interface IStrategy
{
function filter( $record );
}

class FindAfterStrategy implements IStrategy
{
private $_name;

public function __construct( $name )
{
$this->_name = $name;
}

public function filter( $record )
{
return strcmp( $this->_name, $record ) <= 0;
}
}

class RandomStrategy implements IStrategy
{
public function filter( $record )
{
return rand( 0, 1 ) >= 0.5;
}
}

class UserList
{
private $_list = array();

public function __construct( $names )
{
if ( $names != null )
{
foreach( $names as $name )
{
$this->_list []= $name;
}
}
}

public function add( $name )
{
$this->_list []= $name;
}

public function find( $filter )
{
$recs = array();
foreach( $this->_list as $user )
{
if ( $filter->filter( $user ) )
$recs []= $user;
}
return $recs;
}
}

$ul = new UserList( array( "Andy", "Jack", "Lori", "Megan" ) );
$f1 = $ul->find( new FindAfterStrategy( "J" ) );
print_r( $f1 );

$f2 = $ul->find( new RandomStrategy() );
print_r( $f2 );
?>

此代码的 UML 如图 6 所示。

图 6. 用户列表和用于选择用户的策略

UserList 类是打包名称数组的一个包装器。它实现 find 方法,该方法利用几个策略之一来选择这些名称的子集。这些策略由 IStrategy 接口定义,该接口有两个实现:一个随机选择用户,另一个根据指定名称选择其后的所有名称。运行测试代码时,将得到以下输出:
% php strategy.php
Array
(
[0] => Jack
[1] => Lori
[2] => Megan
)
Array
(
[0] => Andy
[1] => Megan
)
%

测试代码为两个策略运行同一用户列表,并显示结果。在第一种情况中,策略查找排列在 J 后的任何名称,所以您将得到 Jack、Lori 和 Megan。第二个策略随机选取名称,每次会产生不同的结果。在这种情况下,结果为 Andy 和 Megan。
策略模式非常适合复杂数据管理系统或数据处理系统,二者在数据筛选、搜索或处理的方式方面需要较高的灵活性。
结束语
本文介绍的仅仅是 PHP 应用程序中使用的几种最常见的设计模式。在设计模式 一书中演示了更多的设计模式。不要因架构的神秘性而放弃。模式是一种绝妙的理念,适用于任何编程语言、任何技能水平。

Ⅱ Delphi的命令行编译命令

Borland出品的Delphi,有着闪电般的编译速度,但是在界面控件使用较多、工程项目较大的时候,编译一个工程仍需要一段时间,打开庞大的Delphi IDE,也需要时间。其实,在一个工程开发结束,调试完成之后的Release编译,完全可以用命令行来执行,因为Delphi的编译器参数不像C++编译器那样复杂。

笔者把Delphi联机手册中关于命令行编译(command-line compiler)的几篇主题作了翻译,希望对Delphi开发人员有帮助。

目录
1. Command-line compiler
命令行编译器
2. Command-line compiler options
命令行编译器选项
3. Compiler directive options
编译器指令选项
4. Compiler mode options
编译模式选项
5. DCC32.CFG file
编译器配置文件DCC32.CFG
6. Debug options
调试选项
7. Directory options
目录选项
8. IDE command-line options
IDE命令行选项
9. Generated files
几个IDE自动生成的文件介绍

Command-line compiler
命令行编译器
Delphi's command-line compiler (dcc32.EXE) lets you invoke all the functions of the IDE compiler (DELPHI32.EXE) from the DOS command line (see IDE command-line options. Run the command-line compiler from the DOS prompt using the syntax:
Delphi’s命令行编译器(dcc32.exe)允许你从DOS命令行方式(参照:IDE命令行选项)实现IDE编译器(delphi32.exe)的所有功能。用DOS命令运行命令行编译器语法如下:
dcc32 [options] filename [options]
dcc32 [选项] [文件名] [选项]
where options are zero or more parameters that provide information to the compiler and filename is the name of the source file to compile. If you type dcc32 alone, it displays a help screen of command-line options and syntax.
零或多个参数给编译器提供信息,文件名指定需要编译的源文件名。如果你单独输入dcc32,它会显示一个关于命令行编译的选项和语法的屏幕。
If filename does not have an extension, the command-line compiler assumes .dpr, then .pas, if no .dpr is found. If the file you're compiling to doesn't have an extension, you must append a period (.) to the end of the filename.
如果文件名没有扩展名,命令行编译器会查找扩展名为.dpr的同名文件,如果找不到,则查找扩展名为.pas的同名文件。如果你的源文件确实没有扩展名,你需要在文件名的末尾添加(.)。
If the source text contained in filename is a program, the compiler creates an executable file named filename.EXE. If filename contains a library, the compiler creates a file named filename.DLL. If filename contains a package, the compiler creates a file named filename.BPL. If filename contains a unit, the compiler creates a unit file named filename.dcu.
如果指定的源文件是一个工程文件,编译器会创建一个扩展名为.EXE的同名可执行文件。如果指定的源文件是一个库文件,编译器创建一个扩展名为.DLL的同名动态链接库文件。如果指定的源文件是一个包文件,编译器会创建一个扩展名为.BPL的同名包。如果指定的源文件是一个单元文件,编译器会创建一个扩展名为.dcu的目标代码文件。
You can specify a number of options for the command-line compiler. An option consists of a slash (/) or immediately followed by an option letter. In some cases, the option letter is followed by additional information, such as a number, a symbol, or a directory name. Options can be given in any order and can come before or after the file name.
你可以为命令行编译器指定多个参数。一个参数包含一个破折号“-”(或“/”)和紧跟着的一个选项字符构成。通常情况下,选项字符后面会跟一些附加的信息,如一个数字、一个符号、一个目录等。选项可以是任意顺序并且可以在源文件名前面或后面。

Command-line compiler options
命令行编译选项
The IDE lets you set various options through the menus; the command-line compiler gives you access to these options using the slash (/) delimiter. You can also precede options with a hyphen (-) instead of a slash (/), but those options that start with a hyphen must be separated by blanks. For example, the following two command lines are equivalent and legal:
IDE允许你使用菜单来设置各种编译选项,而命令行编译器允许你使用字符“/”作为分隔符来设定这些编译选项。你也可以使用连字符“-”来代替“/”,但是用“-”引出的参数之间必须用空格隔开。例如,下面两个命令都是等同的也是合法的:
DCC -IC:\DELPHI -DDEBUG SORTNAME -$R- -$U+
DCC /IC:\DELPHI/DDEBUG SORTNAME /$R-/$U+
The first command line uses hyphens with at least one blank separating options. The second uses slashes and no separation is needed.
第一个编译命令用“-”引出参数,且参数之间有多个空格分隔。第二个编译命令用“/”引出参数,参数之间不必要分隔。
The following table lists the command-line options. In addition to the listed options, all single-letter compiler directives can be specified on the command line, as described in Compiler directive options.
下列表中列出所有的命令行参数。在附加的选项列表中,所有的单字符编译器指令都可以在命令行编译中使用,详情请参照:编译器指令。
Option Description
选项 描述
Aunit=alias 设置单元别名
B 编译所有单元
CC 编译控制台程序
CG 编译图形界面程序
Ddefines 编译条件符号定义
Epath 可执行文件输出路径
Foffset 查找运行期间错误
GD 生成完整.Map文件
GP 生成.Map文件Public段
GS 生成.Map文件Segment段
H 输出提示信息
Ipaths 文件包含路径
J 生成.Obj目标文件
JP 生成C++类型.Obj目标文件
Kaddress Set image base address
LEpath 包.BPL文件输出路径
LNpath .dcp文件输出路径
LUpackage 使用运行期间包列表
M 编译有改动的源文件
Npath dcu/dpu文件输出目录
Opaths .Obj文件(汇编目标代码文件)路径
P 按8.3格式文件名查找
Q 安静模式
Rpaths 资源文件(.RES)路径
TXext 目标文件扩展名
Upaths 单元文件路径
V 为Turbo Debugger生成调试信息文件
VN 以.Giant格式生成包含命名空间的调试信息文件(将用于C++Builder)
VR 生成调试信息文件.rsm
W 输出警告信息
Z Disable implicit compilation
$directive Compiler directives
--Help 显示编译选项的帮助。同样的,如果你在命令行单独输入dcc32,也会显示编译选项的帮助。
--version 显示产品名称和版本

Compiler directive options
编译器指令选项
Delphi supports the compiler directives described in Compiler directives. The $ and D command-line options allow you to change the default states of most compiler directives. Using $ and D on the command line is equivalent to inserting the corresponding compiler directive at the beginning of each source file compiled.
Delphi支持用编译器指令关键字描述的编译器指令。使用“$”和“D”命令行选项可以改变所有的默认编译器状态。用“$”和“D”命令行选项等同于在源文件的前面添加编译器指令。
Switch directive option
编译器指令选项开关
The $ option lets you change the default state of all of the switch directives. The syntax of a switch directive option is $ followed by the directive letter, followed by a plus (+) or a minus (-). For example:
“$”允许你改变每一种编译器指令默认状态。编译器指令的语法是“$”后紧跟一个指令字符,再跟一个“-”或“+”。例如:
dcc32 MYSTUFF -$R-
compiles MYSTUFF.pas with range-checking turned off, while:
不使用边界检查编译MYSTUFF.pas单元:
dcc32 MYSTUFF -$R+
compiles it with range checking turned on. Note that if a {$R+} or {$R-} compiler directive appears in the source text, it overrides the -$R command-line option.
使用界面检查编译MYSTUFF.pas单元。如果将编译器指令{$R+}或{$R-}添加到源文件的开始,它将覆盖从命令行传入的参数。
You can repeat the -$ option in order to specify multiple compiler directives:
你可以用多个“$”来指定多个编译器指令,如:
dcc32 MYSTUFF -$R--$I--$V--$U+
Alternately, the command-line compiler lets you write a list of directives (except for $M), separated by commas:
命令行编译器允许作用逗号分隔的编译器指定列表,如:
dcc32 MYSTUFF -$R-,I-,V-,U+
只需要用一个“$”符号。
Only one dollar sign ($) is needed.
注意,因为$M的格式不一样,你不能在逗号分隔的指令列表中使用$M
Note that, because of its format, you cannot use the $M directive in a list of directives separated by commas.
Conditional defines option
条件编译选项
The -D option lets you define conditional symbols, corresponding to the {$DEFINE symbol} compiler directive. The -D option must be followed by one or more conditional symbols separated by semicolons (;). For example, the following command line:
“-D”选项允许你定义一个编译条件,符合你用{$DEFINE symbol}定义的编译器指令。“-D”选项后必须跟随一或多个用分号分隔的编译条件符号,如下命令:
dcc32 MYSTUFF -DIOCHECK;DEBUG;LIST
defines three conditional symbols, iocheck, debug, and list, for the compilation of MYSTUFF.pas. This is equivalent to inserting:
定义了三个编译条件符号:IOCHECK,DEBUG,LIST,用于MYSTUFF.pas单元中。这等同于在源文件中插入以下语句:
{$DEFINE IOCHECK}
{$DEFINE DEBUG}
{$DEFINE LIST}
at the beginning of MYSTUFF.pas. If you specify multiple -D directives, you can concatenate the symbol lists. Therefore:
如果你指定了多个“-D”选项,你可以联接它们,如下:
dcc32 MYSTUFF -DIOCHECK-DDEBUG-DLIST

is equivalent to the first example.
等同于第一个例子。

Compiler mode options
编译模式选项
A few options affect how the compiler itself functions. As with the other options, you can use these with either the hyphen or the slash format. Remember to separate the options with at least one blank.
有几个选项能影响编译器自身的功能。像其它选项一个,你可以使用“/”或“-”的格式。别忘了用至少一个空格分隔这些选项。
Make (-M) option
选项(-M)
The command-line compiler has built-in MAKE logic to aid in project maintenance. The -M option instructs command-line compiler to check all units upon which the file being compiled depends. Using this option results in a much quicker compile time.
命令行编译器使用构造逻辑的方式来维护工程。“-M”选项指示编译器检查所有与编译文件相关联的文件。用这个参数会导致编译时间增大。
A unit is recompiled under the following conditions:
一个源文件在下列情况下会重新编译:
The source file for that unit has been modified since the unit file was created.
源文件被创建以来被修改过;
用“$I”指令包含的任何文件,用“$L”包含的任何.Obj文件,或用“$R”关联的任何资源文件.Res,比源文件中的要新;
Any file included with the $I directive, any .OBJ file linked in by the $L directive, or any .res file referenced by the $R directive, is newer than the unit file.
The interface section of a unit referenced in a uses statement has changed.
单元接口部分interface的uses段有改动。
Units compiled with the -Z option are excluded from the make logic.
在单元编译时指令“-Z”在构造逻辑期不被接受。
If you were applying this option to the previous example, the command would be:
如果你在上一个例子中使用这个指令,编译命令就应该是:
dcc32 MYSTUFF -M
Build all (-B) option
编译所有 选项(-B)
Instead of relying on the -M option to determine what needs to be updated, you can tell command-line compiler to update all units upon which your program depends using the -B option. You can't use -M and -B at the same time. The -B option is slower than the -M option and is usually unnecessary.
用于取代要知道哪些单元需要更新-M的选项,你可以使用-B选项来更新所有你的程序中关联的单元。你不能在程序中同时使用-M和-B。选项-B比-M速度更慢,而且它并不是必需的。
If you were using this option in the previous example, the command would be
如果你在前一个例子中使用这个参数,编译命令就应该是:
dcc32 MYSTUFF -B
Find error (-F) option
查找错误 选项(-F)
When a program terminates e to a runtime error, it displays an error code and the address at which the error occurred. By specifying that address in a -Faddress option, you can locate the statement in the source text that caused the error, provided your program and units were compiled with debug information enabled (via the $D compiler directive).
当一个程序由于运行期间错误而终止时,它会显示一个错误号和错误地址在错误发生时。用-Faddress选项来指定错误地址,你在源文件中能找到引发错误的位置,如果你的程序和单元编译时附加了调试信息(使用$D编译器指令)。
In order for the command-line compiler to find the runtime error with -F, you must compile the program with all the same command-line parameters you used the first time you compiled it.
为了命令行编译器能用-F选项查找运行期间错误,你必须传递与第一次编译时相同的指令列表。
As mentioned previously, you must compile your program and units with debug information enabled for the command-line compiler to be able to find runtime errors. By default, all programs and units are compiled with debug information enabled, but if you turn it off, using a {$D-} compiler directive or a -$D- option, the command-line compiler will not be able to locate runtime errors.
先前提到过,你的程序和单元必须启用调试信息,命令行编译器才能查找运行期间错误。默认情况下,所有的程序和单都是启用调试信息的,除非你用{-D}或-$D-指令关闭它,这样,命令行编译器就不能查找运行期间错误了。
Use packages (-LU) option
使用包(-LU)选项
Use the -LU option to list additional runtime packages that you want to use in the application being compiled. Runtime packages already listed in the Project Options dialog box need not be repeated on the command line.
使用-LU选项来在编译时添加你应用程序中要用到的运行期间包。运行期间包已经在“工程选项”对话框中列举的,不必再在命令行中添加。
Disable implicit compilation (-Z) option
(此选项在delphi6.0/7.0中有不同描述,在此不作翻译)
The -Z option prevents packages and units from being implicitly recompiled later. With packages, it is equivalent to placing {$ IMPLICITBUILD OFF} in the .dpk file. Use -Z when compiling packages that provide low-level functionality, that change infrequently between builds, or whose source code will not be distributed.
Target file extension (-TX) option
目标文件扩展名(-TX)选项
The -TX option lets you override the default extension for the output file. For example,
选项-TX允许你改写默认的输出文件扩展名。例如:
dcc32 MYSTUFF -TXSYS
generates compiled output in a file called MYSTUFF.SYS.
生成的将是一个叫做MYSTUFF.SYS的文件。
Quiet (-Q) option
安静模式(-Q)选项
The quiet mode option suppresses the printing of file names and line numbers ring compilation. When the command-line compiler is invoked with the quiet mode option
安静模式选项禁止在编译时显示文件名及代码行数,如果命令行编译器调用这个选项的话。
dcc32 MYSTUFF -Q its output is limited to the startup right message and the usual statistics at the end of compilation. If any errors occur, they will be reported.

它的输出仅限于起始时行版权信息以及结尾的统计信息。当然,如果发生错误,它也会输出。

DCC32.CFG file
DCC32.CFG配置文件
You can set up a list of options in a configuration file called DCC32.CFG, which will then be used in addition to the options entered on the command line. Each line in configuration file corresponds to an extra command-line argument inserted before the actual command-line arguments. Thus, by creating a configuration file, you can change the default setting of any command-line option.
你可以设置一个编译选项列表到一个叫做DCC32.CFG的配置文件中,它将用于编译时附加到命令行参数后。配置文件的每一行都相当于一个额外的命令行参数插入到实际的命令行参数前(注意,是实际参数前)。因而,你可以使用这个配置文件改变一些命令行参数的默认设置。
The command-line compiler lets you enter the same command-line option several times, ignoring all but the last occurrence. This way, even though you've changed some settings with a configuration file, you can still override them on the command line.
命令行编译器允许你输入相同的命令行参数,它将忽略所有除最后一个之外。这个的话,尽管通过配置文件你可以改变一些设置,你仍然可以覆盖它使用命令行参数。
When dcc32 starts, it looks for DCC32.CFG in the current directory. If the file isn't found there, dcc32 looks in the directory where DCC32.EXE resides.
当dcc32启动时,它查找DCC32.CFG文件在当前目录。如果文件没有找到,dcc32会查找它所在的目录。
Here's an example DCC32.CFG file, defining some default directories for include, object, and unit files, and changing the default states of the $O and $R compiler directives:
以下是一个DCC32.CFG配置文件的例子,定义了关于文件包含、OBJ文件包含、单元文件搜索路径信息,并改变了编译器指令$O和$R的默认值。
-IC:\DELPHI\INC;C:\DELPHI\SRC
-OC:\DELPHI\ASM
-UC:\DELPHI\UNITS
-$R+
-$O-
Now, if you type:
现在,如果你输入:
dcc32 MYSTUFF
the compiler performs as if you had typed the following:
编译器把它当作你输入如下命令:
dcc32 -IC:\DELPHI\INC;C:\DELPHI\SRC -OC:\DELPHI\ASM -UC:\DELPHI\UNITS -$R+ -$O- MYSTUFF

Debug options
调试选项
The compiler has two sets of command-line options that enable you to generate external debugging information: the map file options and the debug info options.
编译器有两个命令行参数可以生成外部调试信息:MAP文件选项和调试信息选项。
Map file (-G) options
Map文件(-G)选项
The -G option instructs the command-line compiler to generate a .map file that shows the layout of the executable file. Unlike the binary format of executable and .dcu files, a .map file is a legible text file that can be output on a printer or loaded into the editor. The -G option must be followed by the letter S, P, or D to indicate the desired level of information in the .map file. A .MAP file is divided into three sections:
选项-G指示命令行编译器生成一个.map文件来查看一个可执行文件的布局。不同于可二进制的可执行文件和.dcu文件,.map文件是一个可读的文本文件,可以被打印或是其它文本编辑器编辑。选项-G后必须跟字符S、P或D,去决定你想要在.map文件列出的信息。一个.MAP文件被分成三个节:
Segment
Publics
Line Numbers
-GS outputs only the Segment section, -GP outputs the Segment and Publics section, and -GD outputs all three sections. -GD also generates a .DRC file that contains tables of all string constants declared using the resourcestring keyword.
-GS选项只输出Segment Section,-GS选项输出Segment和Publics,-GD输出所有的三个Sections.-GD选项也生成一个扩展名为.DRC的文件包含所有的用resourcestring关键字声明的字符串常量。
For moles (program and units) compiled in the {$D+,L+} state (the default), the Publics section shows all global variables, proceres, and functions, and the Line Numbers section shows line numbers for all proceres and functions in the mole. In the {$D+,L-} state, only symbols defined in a unit's interface part are listed in the Publics section. For moles compiled in the {$D-} state, there are no entries in the Line Numbers section.
用默认的编译选项{$D+,L+}编译模块(程序或单元),Publics Section列举所有的全局变量、过程和函数,Line Numbers Section列举模块中所有的过程和函数的行号。如果用{$D+,L-}编译选项编译模块,Publics Section中仅列举在单元的interface部分定义的符号。如果用{$D-}选项编译模块,在Line Numbers Section没有任何入口。
Debug info (-V) options
调度选项(-V)
The -V options (-V, -VN. and -VR), which cause the compiler to generate debug information, can be combined on the command line.
选项-V、-VN、-VR会指示编译器生成调试信息,它们能在命令行中组合使用。
Generate Turbo Debugger debug info (-V) option
生成Turbo Debugger使用的调试信息的选项(-V)
When you specify the -V option on the command line, the compiler appends Turbo Debugger 5.0-compatible external debug information at the end of the executable file. Turbo Debugger includes both source- and machine-level debugging and powerful breakpoints.
当你在命令行中使用-V选项时,编译器会在可执行文件的末尾附加与Turbo Debugger5.0一致的外部调试信息。Turbo Debugger包含代码和硬件级别的强大的断点。
Even though the debug information generated by -V makes the resulting executable file larger, it does not affect the actual code in the executable, and does not require additional memory to run the program.
虽然附加调试信息到查执行文件中会使可执行文件增大,但是它并不影响实际可执行文件中的可执行代码,也不需要额外的内存来启动程序。
The extent of debug information appended to the executable file depends on the setting of the $D and $L compiler directives in each of the moles (program and units) that make up the application. For moles compiled in the {$D+,L+} state, which is the default, all constant, variable, type, procere, and function symbols are known to the debugger. In the {$D+,L-} state, only symbols defined in a unit's interface section are known to the debugger. In the {$D-} state, no line-number records are generated, so the debugger cannot display source lines whe

Ⅲ 怎样在Delphi里插入版权符号08-CSDN论坛

d2009之前不支持unicode,可以用第三方基于unicode的组件来实现,d2009及以后就直接支持了。

Ⅳ DELPHI怎么用

DELPHI 这样用。
Over!

Ⅳ 如何在命令行上编译我的delphi项目

Borland出品的Delphi,有着闪电般的编译速度,但是在界面控件使用较多、工程项目较大的时候,编译一个工程仍需要一段时间,打开庞大的Delphi IDE,也需要时间。其实,在一个工程开发结束,调试完成之后的Release编译,完全可以用命令行来执行,因为Delphi的编译器参数不像C++编译器那样复杂。

笔者把Delphi联机手册中关于命令行编译(command-line compiler)的几篇主题作了翻译,希望对Delphi开发人员有帮助。

目录
1. Command-line compiler
命令行编译器
2. Command-line compiler options
命令行编译器选项
3. Compiler directive options
编译器指令选项
4. Compiler mode options
编译模式选项
5. DCC32.CFG file
编译器配置文件DCC32.CFG
6. Debug options
调试选项
7. Directory options
目录选项
8. IDE command-line options
IDE命令行选项
9. Generated files
几个IDE自动生成的文件介绍

Command-line compiler
命令行编译器
Delphi's command-line compiler (dcc32.EXE) lets you invoke all the functions of the IDE compiler (DELPHI32.EXE) from the DOS command line (see IDE command-line options. Run the command-line compiler from the DOS prompt using the syntax:
Delphi’s命令行编译器(dcc32.exe)允许你从DOS命令行方式(参照:IDE命令行选项)实现IDE编译器(delphi32.exe)的所有功能。用DOS命令运行命令行编译器语法如下:
dcc32 [options] filename [options]
dcc32 [选项] [文件名] [选项]
where options are zero or more parameters that provide information to the compiler and filename is the name of the source file to compile. If you type dcc32 alone, it displays a help screen of command-line options and syntax.
零或多个参数给编译器提供信息,文件名指定需要编译的源文件名。如果你单独输入dcc32,它会显示一个关于命令行编译的选项和语法的屏幕。
If filename does not have an extension, the command-line compiler assumes .dpr, then .pas, if no .dpr is found. If the file you're compiling to doesn't have an extension, you must append a period (.) to the end of the filename.
如果文件名没有扩展名,命令行编译器会查找扩展名为.dpr的同名文件,如果找不到,则查找扩展名为.pas的同名文件。如果你的源文件确实没有扩展名,你需要在文件名的末尾添加(.)。
If the source text contained in filename is a program, the compiler creates an executable file named filename.EXE. If filename contains a library, the compiler creates a file named filename.DLL. If filename contains a package, the compiler creates a file named filename.BPL. If filename contains a unit, the compiler creates a unit file named filename.dcu.
如果指定的源文件是一个工程文件,编译器会创建一个扩展名为.EXE的同名可执行文件。如果指定的源文件是一个库文件,编译器创建一个扩展名为.DLL的同名动态链接库文件。如果指定的源文件是一个包文件,编译器会创建一个扩展名为.BPL的同名包。如果指定的源文件是一个单元文件,编译器会创建一个扩展名为.dcu的目标代码文件。
You can specify a number of options for the command-line compiler. An option consists of a slash (/) or immediately followed by an option letter. In some cases, the option letter is followed by additional information, such as a number, a symbol, or a directory name. Options can be given in any order and can come before or after the file name.
你可以为命令行编译器指定多个参数。一个参数包含一个破折号“-”(或“/”)和紧跟着的一个选项字符构成。通常情况下,选项字符后面会跟一些附加的信息,如一个数字、一个符号、一个目录等。选项可以是任意顺序并且可以在源文件名前面或后面。

Command-line compiler options
命令行编译选项
The IDE lets you set various options through the menus; the command-line compiler gives you access to these options using the slash (/) delimiter. You can also precede options with a hyphen (-) instead of a slash (/), but those options that start with a hyphen must be separated by blanks. For example, the following two command lines are equivalent and legal:
IDE允许你使用菜单来设置各种编译选项,而命令行编译器允许你使用字符“/”作为分隔符来设定这些编译选项。你也可以使用连字符“-”来代替“/”,但是用“-”引出的参数之间必须用空格隔开。例如,下面两个命令都是等同的也是合法的:
DCC -IC:/DELPHI -DDEBUG SORTNAME -$R- -$U+
DCC /IC:/DELPHI/DDEBUG SORTNAME /$R-/$U+
The first command line uses hyphens with at least one blank separating options. The second uses slashes and no separation is needed.
第一个编译命令用“-”引出参数,且参数之间有多个空格分隔。第二个编译命令用“/”引出参数,参数之间不必要分隔。
The following table lists the command-line options. In addition to the listed options, all single-letter compiler directives can be specified on the command line, as described in Compiler directive options.
下列表中列出所有的命令行参数。在附加的选项列表中,所有的单字符编译器指令都可以在命令行编译中使用,详情请参照:编译器指令。
Option Description
选项 描述
Aunit=alias 设置单元别名
B 编译所有单元
CC 编译控制台程序
CG 编译图形界面程序
Ddefines 编译条件符号定义
Epath 可执行文件输出路径
Foffset 查找运行期间错误
GD 生成完整.Map文件
GP 生成.Map文件Public段
GS 生成.Map文件Segment段
H 输出提示信息
Ipaths 文件包含路径
J 生成.Obj目标文件
JP 生成C++类型.Obj目标文件
Kaddress Set image base address
LEpath 包.BPL文件输出路径
LNpath .dcp文件输出路径
LUpackage 使用运行期间包列表
M 编译有改动的源文件
Npath dcu/dpu文件输出目录
Opaths .Obj文件(汇编目标代码文件)路径
P 按8.3格式文件名查找
Q 安静模式
Rpaths 资源文件(.RES)路径
TXext 目标文件扩展名
Upaths 单元文件路径
V 为Turbo Debugger生成调试信息文件
VN 以.Giant格式生成包含命名空间的调试信息文件(将用于C++Builder)
VR 生成调试信息文件.rsm
W 输出警告信息
Z Disable implicit compilation
$directive Compiler directives
--Help 显示编译选项的帮助。同样的,如果你在命令行单独输入dcc32,也会显示编译选项的帮助。
--version 显示产品名称和版本

Compiler directive options
编译器指令选项
Delphi supports the compiler directives described in Compiler directives. The $ and D command-line options allow you to change the default states of most compiler directives. Using $ and D on the command line is equivalent to inserting the corresponding compiler directive at the beginning of each source file compiled.
Delphi支持用编译器指令关键字描述的编译器指令。使用“$”和“D”命令行选项可以改变所有的默认编译器状态。用“$”和“D”命令行选项等同于在源文件的前面添加编译器指令。
Switch directive option
编译器指令选项开关
The $ option lets you change the default state of all of the switch directives. The syntax of a switch directive option is $ followed by the directive letter, followed by a plus (+) or a minus (-). For example:
“$”允许你改变每一种编译器指令默认状态。编译器指令的语法是“$”后紧跟一个指令字符,再跟一个“-”或“+”。例如:
dcc32 MYSTUFF -$R-
compiles MYSTUFF.pas with range-checking turned off, while:
不使用边界检查编译MYSTUFF.pas单元:
dcc32 MYSTUFF -$R+
compiles it with range checking turned on. Note that if a {$R+} or {$R-} compiler directive appears in the source text, it overrides the -$R command-line option.
使用界面检查编译MYSTUFF.pas单元。如果将编译器指令{$R+}或{$R-}添加到源文件的开始,它将覆盖从命令行传入的参数。
You can repeat the -$ option in order to specify multiple compiler directives:
你可以用多个“$”来指定多个编译器指令,如:
dcc32 MYSTUFF -$R--$I--$V--$U+
Alternately, the command-line compiler lets you write a list of directives (except for $M), separated by commas:
命令行编译器允许作用逗号分隔的编译器指定列表,如:
dcc32 MYSTUFF -$R-,I-,V-,U+
只需要用一个“$”符号。
Only one dollar sign ($) is needed.
注意,因为$M的格式不一样,你不能在逗号分隔的指令列表中使用$M
Note that, because of its format, you cannot use the $M directive in a list of directives separated by commas.
Conditional defines option
条件编译选项
The -D option lets you define conditional symbols, corresponding to the {$DEFINE symbol} compiler directive. The -D option must be followed by one or more conditional symbols separated by semicolons (;). For example, the following command line:
“-D”选项允许你定义一个编译条件,符合你用{$DEFINE symbol}定义的编译器指令。“-D”选项后必须跟随一或多个用分号分隔的编译条件符号,如下命令:
dcc32 MYSTUFF -DIOCHECK;DEBUG;LIST
defines three conditional symbols, iocheck, debug, and list, for the compilation of MYSTUFF.pas. This is equivalent to inserting:
定义了三个编译条件符号:IOCHECK,DEBUG,LIST,用于MYSTUFF.pas单元中。这等同于在源文件中插入以下语句:
{$DEFINE IOCHECK}
{$DEFINE DEBUG}
{$DEFINE LIST}
如果你指定了多个“-D”选项,你可以联接它们,如下:
dcc32 MYSTUFF -DIOCHECK-DDEBUG-DLIST
等同于第一个例子。
编译模式选项
有几个选项能影响编译器自身的功能。像其它选项一个,你可以使用“/”或“-”的格式。别忘了用至少一个空格分隔这些选项。
选项(-M)
命令行编译器使用构造逻辑的方式来维护工程。“-M”选项指示编译器检查所有与编译文件相关联的文件。用这个参数会导致编译时间增大。
一个源文件在下列情况下会重新编译:
The source file for that unit has been modified since the unit file was created.
源文件被创建以来被修改过;
用“$I”指令包含的任何文件,用“$L”包含的任何.Obj文件,或用“$R”关联的任何资源文件.Res,比源文件中的要新;
单元接口部分interface的uses段有改动。
在单元编译时指令“-Z”在构造逻辑期不被接受。
If you were applying this option to the previous example, the command would be:
如果你在上一个例子中使用这个指令,编译命令就应该是:
dcc32 MYSTUFF -M
编译所有 选项(-B)
用于取代要知道哪些单元需要更新-M的选项,你可以使用-B选项来更新所有你的程序中关联的单元。你不能在程序中同时使用-M和-B。选项-B比-M速度更慢,而且它并不是必需的。
如果你在前一个例子中使用这个参数,编译命令就应该是:
dcc32 MYSTUFF -B
查找错误 选项(-F)
当一个程序由于运行期间错误而终止时,它会显示一个错误号和错误地址在错误发生时。用-Faddress选项来指定错误地址,你在源文件中能找到引发错误的位置,如果你的程序和单元编译时附加了调试信息(使用$D编译器指令)。
为了命令行编译器能用-F选项查找运行期间错误,你必须传递与第一次编译时相同的指令列表。
先前提到过,你的程序和单元必须启用调试信息,命令行编译器才能查找运行期间错误。默认情况下,所有的程序和单都是启用调试信息的,除非你用{-D}或-$D-指令关闭它,这样,命令行编译器就不能查找运行期间错误了。
使用包(-LU)选项
使用-LU选项来在编译时添加你应用程序中要用到的运行期间包。运行期间包已经在“工程选项”对话框中列举的,不必再在命令行中添加。
Disable implicit compilation (-Z) option
(此选项在delphi6.0/7.0中有不同描述,在此不作翻译)
目标文件扩展名(-TX)选项
选项-TX允许你改写默认的输出文件扩展名。例如:
dcc32 MYSTUFF -TXSYS
生成的将是一个叫做MYSTUFF.SYS的文件。
Quiet (-Q) option
安静模式(-Q)选项
安静模式选项禁止在编译时显示文件名及代码行数,如果命令行编译器调用这个选项的话。

它的输出仅限于起始时行版权信息以及结尾的统计信息。当然,如果发生错误,它也会输出。

DCC32.CFG file
DCC32.CFG配置文件
你可以设置一个编译选项列表到一个叫做DCC32.CFG的配置文件中,它将用于编译时附加到命令行参数后。配置文件的每一行都相当于一个额外的命令行参数插入到实际的命令行参数前(注意,是实际参数前)。因而,你可以使用这个配置文件改变一些命令行参数的默认设置。
命令行编译器允许你输入相同的命令行参数,它将忽略所有除最后一个之外。这个的话,尽管通过配置文件你可以改变一些设置,你仍然可以覆盖它使用命令行参数。
当dcc32启动时,它查找DCC32.CFG文件在当前目录。如果文件没有找到,dcc32会查找它所在的目录。
以下是一个DCC32.CFG配置文件的例子,定义了关于文件包含、OBJ文件包含、单元文件搜索路径信息,并改变了编译器指令$O和$R的默认值。
-IC:/DELPHI/INC;C:/DELPHI/SRC
-OC:/DELPHI/ASM
-UC:/DELPHI/UNITS
-$R+
-$O-
现在,如果你输入:
dcc32 MYSTUFF
编译器把它当作你输入如下命令:
dcc32 -IC:/DELPHI/INC;C:/DELPHI/SRC -OC:/DELPHI/ASM -UC:/DELPHI/UNITS -$R+ -$O- MYSTUFF
调试选项
编译器有两个命令行参数可以生成外部调试信息:MAP文件选项和调试信息选项。
Map file (-G) options
Map文件(-G)选项
选项-G指示命令行编译器生成一个.map文件来查看一个可执行文件的布局。不同于可二进制的可执行文件和.dcu文件,.map文件是一个可读的文本文件,可以被打印或是其它文本编辑器编辑。选项-G后必须跟字符S、P或D,去决定你想要在.map文件列出的信息。一个.MAP文件被分成三个节:
Segment
Publics
Line Numbers
-GS选项只输出Segment Section,-GS选项输出Segment和Publics,-GD输出所有的三个Sections.-GD选项也生成一个扩展名为.DRC的文件包含所有的用resourcestring关键字声明的字符串常量。
用默认的编译选项{$D+,L+}编译模块(程序或单元),Publics Section列举所有的全局变量、过程和函数,Line Numbers Section列举模块中所有的过程和函数的行号。如果用{$D+,L-}编译选项编译模块,Publics Section中仅列举在单元的interface部分定义的符号。如果用{$D-}选项编译模块,在Line Numbers Section没有任何入口。
调度选项(-V)
选项-V、-VN、-VR会指示编译器生成调试信息,它们能在命令行中组合使用。
生成Turbo Debugger使用的调试信息的选项(-V)
当你在命令行中使用-V选项时,编译器会在可执行文件的末尾附加与Turbo Debugger5.0一致的外部调试信息。Turbo Debugger包含代码和硬件级别的强大的断点。
虽然附加调试信息到查执行文件中会使可执行文件增大,但是它并不影响实际可执行文件中的可执行代码,也不需要额外的内存来启动程序。

Ⅵ 怎样在Delphi里插入版权符号08

第一步打开我们电脑上的Dreamweaver,小编在这里新建一个网页做样例
第二步这回里先设置一下字体,方答便观看效果
第三步在浏览器看了一下效果之后,我们点击“插入->HTML->特殊字符->版权”
第四步在浏览器里面观看,可以看到已经插入版权符号了

第五步我们也可以网络搜索“html有用的字符实体”,直接将下面的复制到dreamweaver网页里面去

Ⅶ delphi单元有那些以及单元的作用

Borland出品的Delphi,有着闪电般的编译速度,但是在界面控件运用较多、工程项目较大的时分,编译一个工程仍需求一段时间,翻开庞大的Delphi IDE,也需求时间。其实,在一个工程开拓完毕,调试完成之后的Release编译,完整可以用命令行来实施,由于Delphi的编译器参数不像C++编译器那样繁杂。 笔者把Delphi联机手册中关于命令行编译(。mand-line 。piler)的几篇主题作了翻译,希冀对Delphi开拓人员有辅佐。 目录 1。 Command-line 。piler 命令行编译器 2。 Command-line 。piler options 命令行编译器选项 3。 Compiler directive options 编译器指令选项 4。 Compiler mode options 编译形式选项 5。 DCC32。CFG file 编译器配置文件DCC32。CFG 6。 Debug options 调试选项 7。 Directory options 目录选项 8。 IDE 。mand-line options IDE命令行选项 9。 Generated files 几个IDE自动生成的文件引见 Command-line 。piler 命令行编译器 Delphi's 。mand-line 。piler (dcc32。EXE) lets you invoke all the functions of the IDE 。piler (DELPHI32。EXE) from the DOS 。mand line (see IDE 。mand-line options。 Run the 。mand-line 。piler from the DOS prompt using the syntax: Delphi’s命令行编译器(dcc32。exe)容许你从DOS命令行方式(参照:IDE命令行选项)完成IDE编译器(delphi32。exe)的一切功用。用DOS命令运转命令行编译器语法如下: dcc32 [options] filename [options] dcc32 [选项] [文件名] [选项] where options are zero or more parameters that provide 。rmation to the 。piler and filename is the name of the source file to 。pile。 If you type dcc32 alone, it displays a help screen of 。mand-line options and syntax。 零或多个参数给编译器提供音讯,文件名指定需求编译的源文件名。假设你独自输入dcc32,它会显现一个关于命令行编译的选项和语法的屏幕。 If filename does not have an extension, the 。mand-line 。piler assumes 。dpr, then 。pas, if no 。dpr is found。 If the file you're 。piling to doesn't have an extension, you must append a period (。) to the end of the filename。 假设文件名没有扩展名,命令行编译器会查找扩展名为。dpr的同名文件,假设找不到,则查找扩展名为。pas的同名文件。假设你的源文件确实没有扩展名,你需求在文件名的开端增加(。)。 If the source text contained in filename is a program, the 。piler creates an executable file named filename。EXE。 If filename contains a library, the 。piler creates a file named filename。DLL。 If filename contains a package, the 。piler creates a file named filename。BPL。 If filename contains a unit, the 。piler creates a unit file named filename。dcu。 假设指定的源文件是一个工程文件,编译器会创立一个扩展名为。EXE的同名可实施文件。假设指定的源文件是一个库文件,编译器创立一个扩展名为。DLL的同名静态链接库文件。假设指定的源文件是一个包文件,编译器会创立一个扩展名为。BPL的同名包。假设指定的源文件是一个单元文件,编译器会创立一个扩展名为。dcu的目的代码文件。 You can specify a number of options for the 。mand-line 。piler。 An option consists of a slash (。) or immediately followed by an option letter。 In some cases, the option letter is followed by additional 。rmation, such as a number, a symbol, or a directory name。 Options can be given in any order and can 。e before or after the file name。 你可以为命令行编译器指定多个参数。一个参数包括一个破折号“-”(或“。”)和紧跟着的一个选项字符形成。一般状况下,选项字符前面会跟一些附加的音讯,如一个数字、一个符号、一个目录等。选项可以是恣意次第并且可以在源文件名前面或前面。 Command-line 。piler options 命令行编译选项 The IDE lets you set various options through the menus; the 。mand-line 。piler gives you access to these options using the slash (。) delimiter。 You can also precede options with a hyphen (-) instead of a slash (。), but those options that start with a hyphen must be separated by blanks。 For example, the following two 。mand lines are equivalent and legal: IDE容许你运用菜单来设置各种编译选项,而命令行编译器容许你运用字符“。”作为分隔符来设定这些编译选项。你也可以运用连字符“-”来替代“。”,但是用“-”引出的参数之间必需用空格隔开。例如,下面两个命令都是同等的也是合法的: DCC -IC:\DELPHI -DDEBUG SORTNAME -$R- -$U+ DCC 。IC:\DELPHI。DDEBUG SORTNAME 。$R-。$U+ The first 。mand line uses hyphens with at least one blank separating options。 The second uses slashes and no separation is needed。 第一个编译命令用“-”引出参数,且参数之间有多个空格分隔。第二个编译命令用“。”引出参数,参数之间不用要分隔。 The following table lists the 。mand-line options。 In addition to the listed options, all single-letter 。piler directives can be specified on the 。mand line, as described in Compiler directive options。 下列表中列出一切的命令行参数。在附加的选项列表中,一切的单字符编译器指令都可以在命令行编译中运用,概略请参照:编译器指令。 Option Description 选项 描画 Aunit=alias 设置单元别名 B 编译一切单元 CC 编译掌握台顺序 CG 编译图形界面顺序 Ddefines 编译条件符号定义 Epath 可实施文件输入途径 Foffset 查找运转时期过失 GD 生成完整。Map文件 GP 生成。Map文件Public段 GS 生成。Map文件Segment段 H 输入提示音讯 Ipaths 文件包括途径 J 生成。Obj目的文件 JP 生成C++类型。Obj目的文件 Kaddress Set image base address LEpath 包。BPL文件输入途径 LNpath 。dcp文件输入途径 LUpackage 运用运转时期包列表 M 编译有改动的源文件 Npath dcu。dpu文件输入目录 Opaths 。Obj文件(汇编目的代码文件)途径 P 按8。3格式文件名查找 Q 恬静形式 Rpaths 资源文件(。RES)途径 TXext 目的文件扩展名 Upaths 单元文件途径 V 为Turbo Debugger生成调试音讯文件 VN 以。Giant格式生成包括命名空间的调试音讯文件(将用于C++Builder) VR 生成调试音讯文件。rsm W 输入正告音讯 Z Disable implicit 。pilation $directive Compiler directives --Help 显现编译选项的辅佐。异样的,假设你在命令行独自输入dcc32,也会显现编译选项的辅佐。 --version 显现产品称号和版本 Compiler directive options 编译器指令选项 Delphi supports the 。piler directives described in Compiler directives。 The $ and D 。mand-line options allow you to change the default states of most 。piler directives。 Using $ and D on the 。mand line is equivalent to inserting the corresponding 。piler directive at the beginning of each source file 。piled。 Delphi支持用编译器指令关键字描画的编译器指令。运用“$”和“D”命令行选项可以改动一切的默许编译器形状。用“$”和“D”命令行选项同等于在源文件的前面增加编译器指令。 Switch directive option 编译器指令选项开关 The $ option lets you change the default state of all of the switch directives。 The syntax of a switch directive option is $ followed by the directive letter, followed by a plus (+) or a minus (-)。 For example: “$”容许你改动每一种编译器指令默许形状。编译器指令的语法是“$”后紧跟一个指令字符,再跟一个“-”或“+”。例如: dcc32 MYSTUFF -$R- 。piles MYSTUFF。pas with range-checking turned off, while: 不运用边境检查编译MYSTUFF。pas单元: dcc32 MYSTUFF -$R+ 。piles it with range checking turned on。 Note that if a {$R+} or {$R-} 。piler directive appears in the source text, it overrides the -$R 。mand-line option。 运用界面检查编译MYSTUFF。pas单元。假设将编译器指令{$R+}或{$R-}增加到源文件的开端,它将掩盖从命令行传入的参数。 You can repeat the -$ option in order to specify multiple 。piler directives: 你可以用多个“$”来指定多个编译器指令,如: dcc32 MYSTUFF -$R--$I--$V--$U+ Alternately, the 。mand-line 。piler lets you write a list of directives (except for $M), separated by 。mas: 命令行编译器容许作用逗号分隔的编译器指定列表,如: dcc32 MYSTUFF -$R-,I-,V-,U+ 只需求用一个“$”符号。 Only one dollar sign ($) is needed。 留意,由于$M的格式不一样,你不能在逗号分隔的指令列表中运用$M Note that, because of its format, you cannot use the $M directive in a list of directives separated by 。mas。 Conditional defines option 条件编译选项 The -D option lets you define conditional symbols, corresponding to the {$DEFINE symbol} 。piler directive。 The -D option must be followed by one or more conditional symbols separated by semicolons (;)。 For example, the following 。mand line: “-D”选项容许你定义一个编译条件,契合你用{$DEFINE symbol}定义的编译器指令。“-D”选项后必需跟随一或多个用分号分隔的编译条件符号,如下命令: dcc32 MYSTUFF -DIOCHECK;DEBUG;LIST defines three conditional symbols, iocheck, debug, and list, for the 。pilation of MYSTUFF。pas。 This is equivalent to inserting: 定义了三个编译条件符号:IOCHECK,DEBUG,LIST,用于MYSTUFF。pas单元中。这同等于在源文件中插入以下语句: {$DEFINE IOCHECK} {$DEFINE DEBUG} {$DEFINE LIST} at the beginning of MYSTUFF。pas。 If you specify multiple -D directives, you can concatenate the symbol lists。 Therefore: 假设你指定了多个“-D”选项,你可以衔接它们,如下: dcc32 MYSTUFF -DIOCHECK-DDEBUG-DLIST is equivalent to the first example。 同等于第一个例子。 Compiler mode options 编译形式选项 A few options affect how the 。piler itself functions。 As with the other options, you can use these with either the hyphen or the slash format。 Remember to separate the options with at least one blank。 有几个选项能影响编译器自身的功用。像其它选项一个,你可以运用“。”或“-”的格式。别忘了用至少一个空格分隔这些选项。 Make (-M) option 选项(-M) The 。mand-line 。piler has built-in MAKE logic to aid in project maintenance。 The -M option instructs 。mand-line 。piler to check all units upon which the file being 。piled depends。 Using this option results in a much quicker 。pile time。 命令行编译器运用结构逻辑的方式来维护工程。“-M”选项指示编译器检查一切与编译文件相关联的文件。用这个参数会招致编译时间增大。 A unit is re。piled under the following conditions: 一个源文件在下列状况下会重新编译: The source file for that unit has been modified since the unit file was created。 源文件被创立以来被修正过; 用“$I”指令包括的任何文件,用“$L”包括的任何。Obj文件,或用“$R”关联的任何资源文件。Res,比源文件中的要新; Any file included with the $I directive, any 。OBJ file linked in by the $L directive, or any 。res file referenced by the $R directive, is newer than the unit file。 The interface section of a unit referenced in a uses statement has changed。 单元接口局部interface的uses段有改动。 Units 。piled with the -Z option are excluded from the make logic。 在单元编译时指令“-Z”在结构逻辑期不被接受。 If you were applying this option to the previous example, the 。mand would be: 假设你在上一个例子中运用这个指令,编译命令就应当是: dcc32 MYSTUFF -M Build all (-B) option 编译一切 选项(-B) Instead of relying on the -M option to determine what needs to be updated, you can tell 。mand-line 。piler to update all units upon which your program depends using the -B option。 You can't use -M and -B at the same time。 The -B option is slower than the -M option and is usually unnecessary。 用于取代要知道哪些单元需求更新-M的选项,你可以运用-B选项来更新一切你的顺序中关联的单元。你不能在顺序中同时运用-M和-B。选项-B比-M速度更慢,而且它并不是必需的。 If you were using this option in the previous example, the 。mand would be 假设你在前一个例子中运用这个参数,编译命令就应当是: dcc32 MYSTUFF -B Find error (-F) option 查找过失 选项(-F) When a program terminates e to a runtime error, it displays an error code and the address at which the error occurred。 By specifying that address in a -Faddress option, you can locate the statement in the source text that caused the error, provided your program and units were 。piled with debug 。rmation enabled (via the $D 。piler directive)。 当一个顺序由于运转时期过失而终止时,它会显现一个过失号和过失地址在过失发生时。用-Faddress选项来指定过失地址,你在源文件中能找到引发过失的位置,假设你的顺序和单元编译时附加了调试音讯(运用$D编译器指令)。 In order for the 。mand-line 。piler to find the runtime error with -F, you must 。pile the program with all the same 。mand-line parameters you used the first time you 。piled it。 为了命令行编译器能用-F选项查找运转时期过失,你必需传递与第一次编译时相同的指令列表。 As mentioned previously, you must 。pile your program and units with debug 。rmation enabled for the 。mand-line 。piler to be able to find runtime errors。 By default, all programs and units are 。piled with debug 。rmation enabled, but if you turn it off, using a {$D-} 。piler directive or a -$D- option, the 。mand-line 。piler will not be able to locate runtime errors。 先前提到过,你的顺序和单元必需启用调试音讯,命令行编译器才干查找运转时期过失。默许状况下,一切的顺序和单都是启用调试音讯的,除非你用{-D}或-$D-指令封锁它,这样,命令行编译器就不能查找运转时期过失了。 Use packages (-LU) option 运用包(-LU)选项 Use the -LU option to list additional runtime packages that you want to use in the application being 。piled。 Runtime packages already listed in the Project Options dialog box need not be repeated on the 。mand line。 运用-LU选项来在编译时增加你运用顺序中要用到的运转时期包。运转时期包曾经在“工程选项”对话框中罗列的,不用再在命令行中增加。 Disable implicit 。pilation (-Z) option (此选项在delphi6。0。7。0中有不同描画,在此不作翻译) The -Z option prevents packages and units from being implicitly re。piled later。 With packages, it is equivalent to placing {$ IMPLICITBUILD OFF} in the 。dpk file。 Use -Z when 。piling packages that provide low-level functionality, that change infrequently between builds, or whose source code will not be distributed。 Target file extension (-TX) option 目的文件扩展名(-TX)选项 The -TX option lets you override the default extension for the output file。 For example, 选项-TX容许你改写默许的输入文件扩展名。例如: dcc32 MYSTUFF -TXSYS generates 。piled output in a file called MYSTUFF。SYS。 生成的将是一个叫做MYSTUFF。SYS的文件。 Quiet (-Q) option 恬静形式(-Q)选项 The quiet mode option suppresses the printing of file names and line numbers ring 。pilation。 When the 。mand-line 。piler is invoked with the quiet mode option 恬静形式选项制止在编译时显现文件名及代码行数,假设命令行编译器调用这个选项的话。 dcc32 MYSTUFF -Q its output is limited to the startup right message and the usual statistics at the end of 。pilation。 If any errors occur, they will be reported。 它的输入仅限于起始时行版权音讯以及开头的统计音讯。当然,假设发生过失,它也会输入。 DCC32。CFG file DCC32。CFG配置文件 You can set up a list of options in a configuration file called DCC32。CFG, which will then be used in addition to the options entered on the 。mand line。 Each line in configuration file corresponds to an extra 。mand-line argument inserted before the actual 。mand-line arguments。 Thus, by creating a configuration file, you can change the default setting of any 。mand-line option。 你可以设置一个编译选项列表到一个叫做DCC32。CFG的配置文件中,它将用于编译时附加到命令行参数后。配置文件的每一行都相当于一个额外的命令行参数插入到实践的命令行参数前(留意,是实践参数前)。因此,你可以运用这个配置文件改动一些命令行参数的默许设置。 The 。mand-line 。piler lets you enter the same 。mand-line option several times, ignoring all but the last occurrence。 This way, even though you've changed some settings with a configuration file, you can still override them on the 。mand line。 命令行编译器容许你输入相同的命令行参数,它将疏忽一切除最后一个之外。这个的话,固然经过配置文件你可以改动一些设置,你依然可以掩盖它运用命令行参数。 When dcc32 starts, it looks for DCC32。CFG in the current directory。 If the file isn't found there, dcc32 looks in the directory where DCC32。EXE resides。 当dcc32发起时,它查找DCC32。CFG文件在以后目录。假设文件没有找到,dcc32会查找它所在的目录。 Here's an example DCC32。CFG file, defining some default directories for include, object, and unit files, and changing the default states of the $O and $R 。piler directives: 以下是一个DCC32。CFG配置文件的例子,定义了关于文件包括、OBJ文件包括、单元文件搜寻途径音讯,并改动了编译器指令$O和$R的默许值。 -IC:\DELPHI\INC;C:\DELPHI\SRC -OC:\DELPHI\ASM -UC:\DELPHI\UNITS -$R+ -$O- Now, if you type: 往常,假设你输入: dcc32 MYSTUFF the 。piler performs as if you had typed the following: 编译器把它当作你输入如下命令: dcc32 -IC:\DELPHI\INC;C:\DELPHI\SRC -OC:\DELPHI\ASM -UC:\DELPHI\UNITS -$R+ -$O- MYSTUFF Debug options 调试选项 The 。piler has two sets of 。mand-line options that enable you to generate external debugging 。rmation: the map file options and the debug 。 options。 编译器有两个命令行参数可以生成外部调试音讯:MAP文件选项和调试音讯选项。 Map file (-G) options Map文件(-G)选项 The -G option instructs the 。mand-line 。piler to generate a 。map file that shows the layout of the executable file。 Unlike the binary format of executable and 。dcu files, a 。map file is a legible text file that can be output on a printer or loaded into the editor。 The -G option must be followed by the letter S, P, or D to indicate the desired level of 。rmation in the 。map file。 A 。MAP file is divided into three sections: 选项-G指示命令行编译器生成一个。map文件来检查一个可实施文件的布局。不同于可二进制的可实施文件和。dcu文件,。map文件是一个可读的文本文件,可以被打印或是其它文本编辑器编辑。选项-G后必需跟字符S、P或D,去决议你想要在。map文件列出的音讯。一个。MAP文件被分红三个节: Segment Publics Line Numbers -GS outputs only the Segment section, -GP outputs the Segment and Publics section, and -GD outputs all three sections。 -GD also generates a 。DRC file that contains tables of all string constants declared using the resourcestring keyword。 -GS选项只输入Segment Section,-GS选项输入Segment和Publics,-GD输入一切的三个Sections。-GD选项也生成一个扩展名为。DRC的文件包括一切的用resourcestring关键字声明的字符串常量。 For moles (program and units) 。piled in the {$D+,L+} state (the default), the Publics section shows all global variables, proceres, and functions, and the Line Numbers section shows line numbers for all proceres and functions in the mole。 In the {$D+,L-} state, only symbols defined in a unit's interface part are listed in the Publics section。 For moles 。piled in the {$D-} state, there are no entries in the Line Numbers section。 用默许的编译选项{$D+,L+}编译模块(顺序或单元),Publics Section罗列一切的全局变量、进程和函数,Line Numbers Section罗列模块中一切的进程和函数的行号。假设用{$D+,L-}编译选项编译模块,Publics Section中仅罗列在单元的interface局部定义的符号。假设用{$D-}选项编译模块,在Line Numbers Section没有任何入口。 Debug 。 (-V) options 布置选项(-V) The -V options (-V, -VN。 and -VR), which cause the 。piler to generate debug 。rmation, can be 。bined on the 。mand line。 选项-V、-VN、-VR会指示编译器生成调试音讯,它们能在命令行中组合运用。 Generate Turbo Debugger debug 。 (-V) option 生成Turbo Debugger运用的调试音讯的选项(-V) When you specify the -V option on the 。mand line, the 。piler appends Turbo Debugger 5。0-。patible external debug 。rmation at the end of the executable file。 Turbo Debugger includes both source- and machine-level debugging and powerful breakpoints。 当你在命令行中运用-V选项时,编译器会在可实施文件的开端附加与Turbo Debugger5。0一致的外部调试音讯。Turbo Debugger包括代码和硬件级别的弱小的断点。 Even though the debug 。rmation generated by -V makes the resulting executable file larger, it does not affect the actual code in the executable, and does not require additional memory to run the program。 固然附加调试音讯到查实施文件中会使可实施文件增大,但是它并不影响实践可实施文件中的可实施代码,也不需求额外的内存来发起顺序。 The extent of debug 。rmation appended to the executable file depends on the setting of the $D and $L 。piler directives in each of the moles (program and units) that make up the application。 For moles 。piled in the {$D+,L+} state, which is the default, all constant, variable, type, procere, and function symbols are known to the debugger。 In the {$D+,L-} state, only symbols defined in a unit's interface section are known to the debugger。 In the {$D-} state, no line-number records are generated, so the debugger cannot display source lines whe 2011-10-24 7:49:57

阅读全文

与delphi版权符号相关的资料

热点内容
发明文言文 浏览:523
国培线下专题研修成果 浏览:577
马鞍山苏丛勇 浏览:109
人民的名义侵权问题 浏览:53
全椒到马鞍山汽车时刻表 浏览:899
logo可用字体版权 浏览:861
马鞍山中豪 浏览:929
tefl证书在哪里考 浏览:564
小陆离与成果 浏览:654
迷你世界冒险转化创造 浏览:680
2014纳税申报期限 浏览:274
lol2016猴年限定皮肤 浏览:48
陕西房地产估价师证书领取地点 浏览:140
证书小知识 浏览:431
马鞍山何兵 浏览:376
设计创作版权合作合同范本 浏览:482
省知识产权局侯社教 浏览:51
道闸3C证书 浏览:820
土地使用权期满地上建筑物 浏览:455
武汉圆通快递投诉电话 浏览:33