转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
Delphi for .Net 编译器预览 - by John Kaster         ★★★★

Delphi for .Net 编译器预览 - by John Kaster

作者:闵涛 文章来源:闵涛的学习笔记 点击数:3192 更新时间:2009/4/23 18:39:15
 
Welcome zhang jinyu www.borland.com  AppServer   C++   CORBA   Delphi & Kylix   InterBase   Java   Linux   TeamSource DSP  Borland Developer Network Home >Delphi & Kylix> Platforms


Delphi for .NET compiler preview - by John Kaster

Abstract:A first look at the Delphi for .NET compiler features and Delphi''''s new language syntax

by John Kaster and Danny Thorpe

At BorCon 2002, Borland started providing more technical details on our support under development for the .NET platform. This article introduces some of the planned enhancements to the Delphi language and introduces the prototype "Delphi for .NET" compiler. Unless otherwise indicated, the language features discussed here will first be seen in the Delphi for .NET compiler. Furthermore, all of the features discussed in this article may not be introduced in the preview release. When possible, features already implemented in the compiler will be listed, but since the compiler is in beta right now, not much emphasis will be placed on distinguishing what''''s currently implemented and what''''s not.

For a good, brief overview of .NET and an introduction to some of the terms mentioned in this article, see http://arstechnica.com/paedia/n/net/net-1.html.

DCCIL

The Delphi for .NET compiler produces Common Intermediate Language (CIL) applications. These applications can run anywhere the .NET run-time is available as fully managed applications. This means that Delphi applications can now move beyond their traditional Windows/Intel platform to any other platform that has a .NET runtime, such as the .NET compact framework available for tablet PCs, phones, and PDAs.

The Delphi command line compiler for IL is dccil.exe. Here''''s what currently shows up when you run it without any parameters. (This output is guaranteed to change before we release the Delphi for .NET preview with Delphi 7.)


Borland Delphi Version 16.0
Copyright (c) 1983,2002 Borland Software Corporation
Confidential pre-release version built Aug  2 2002 17:29:33

Syntax: dccil [options] filename [options]

  -A<unit>=<alias> = Set unit alias  -LU<package> = Use package
  -B = Build all units               -M = Make modified units
  -CC = Console target               -N<path> = DCU output directory
  -CG = GUI target                   -O<paths> = Object directories
  -D<syms> = Define conditionals     -P = look for 8.3 file names also
  -E<path> = EXE output directory    -Q = Quiet compile
  -F<offset> = Find error            -R<paths> = Resource directories
  -GD = Detailed map file            -U<paths> = Unit directories
  -GP = Map file with publics        -V = Debug information in EXE
  -GS = Map file with segments       -VR = Generate remote debug (RSM)
  -H = Output hint messages          -W = Output warning messages
  -I<paths> = Include directories    -Z = Output ''''never build'''' DCPs
  -J = Generate .obj file            -$<dir> = Compiler directive
  -JP = Generate C++ .obj file       --help = Show this help screen
  -K<addr> = Set image base addr     --version = Show name and version
Compiler switches: -$<letter><state> (defaults are shown below)
  A8  Aligned record fields           P+  Open string params
  B-  Full boolean Evaluation         Q-  Integer overflow checking
  C+  Evaluate assertions at runtime  R-  Range checking
  D+  Debug information               T-  Typed @ operator
  G+  Use imported data references    U-  Pentium(tm)-safe divide
  H+  Use long strings by default     V+  Strict var-strings
  I+  I/O checking                    W-  Generate stack frames
  J-  Writeable structured consts     X+  Extended syntax
  L+  Local debug symbols             Y+  Symbol reference info
  M-  Runtime type info               Z1  Minimum size of enum types
  O+  Optimization
product version: VER160
debug level: 2

In an effort to maintain the trend of asking about pronunciations ("Is it ''''delf-ee'''' or ''''delf-eye''''?"), I feel obligated to mention that the R&D team pronounces the compiler as "diesel."

A Delphi for .NET GUI application

As with Kylix, a basic step in our .NET support was getting a compiler that actually produces the appropriate "machine code" executable. In this case, that machine is .NET. A form designer is not currently available for Delphi for .NET, so you will notice that the following code actually initializes the menu items, button, listbox, and up/down control.


program ConvertIt;

uses
  System.Drawing,
  Borland.Delphi.SysUtils, Borland.Delphi.Conversions, Borland.Vcl.Controls;

type
  TForm1 = class(TForm)
  private
    DoitButton: TButton;
    CelsiusEdit: TSpinEdit;
    ResultList: TListBox;
    MainMenu: TMainMenu;
    FileItem: TMenuItem;
    ExitItem: TMenuItem;
    HelpItem: TMenuItem;
    AboutItem: TMenuItem;
    procedure DoitButtonClick(Sender: TObject; Args: TEventArgs);
    procedure ExitItemClick(Sender: TObject; Args: TEventArgs);
    procedure AboutItemClick(Sender: TObject; Args: TEventArgs);
  protected
    function DecimalToFloat(const AValue: Decimal): Double;
    function FloatToDecimal(const AValue: Double): Decimal;
    procedure ReadState;
  public
    constructor Create;

    procedure Convert;
  end;

var
  Form1: TForm1;

function TForm1.DecimalToFloat(const AValue: Decimal): Double;
begin
  Result := System.Convert.ToDouble(AValue);
end;

function TForm1.FloatToDecimal(const AValue: Double): Decimal;
begin
  Result := System.Convert.ToDecimal(AValue);
end;

procedure TForm1.Convert;
var
  LCelsius: Double;

  function NthDegree(const Scale: string; const Temperature: double): string;
  begin
    Result := Format(''''%s = %8.2f'''', [Scale, Temperature]);
  end;

begin
  LCelsius := DecimalToFloat(CelsiusEdit.Value);
  with ResultList.Items do
  begin
    Clear;
    Add(NthDegree(''''Celsius'''', LCelsius));
    Add(NthDegree(''''Fahrenheit'''', CelsiusToFahrenheit(LCelsius)));
    Add(NthDegree(''''Kelvin'''', CelsiusToKelvin(LCelsius)));
    Add(NthDegree(''''Rankine'''', CelsiusToRankine(LCelsius)));
    Add(NthDegree(''''Reaumur'''', CelsiusToReaumur(LCelsius)));
  end;
end;

procedure TForm1.DoitButtonClick(Sender: TObject; Args: TEventArgs);
begin
  Convert;
end;

procedure TForm1.ExitItemClick(Sender: TObject; Args: TEventArgs);
begin
  Close;
end;

procedure TForm1.AboutItemClick(Sender: TObject; Args: TEventArgs);
begin
  TMessageBox.Show(Text + '''' whatever'''');
end;

constructor TForm1.Create;
begin
  inherited Create;

  ReadState;
end;

procedure TForm1.ReadState;
begin
  MainMenu := TMainMenu.Create;
  FileItem := TMenuItem.Create;
  ExitItem := TMenuItem.Create;
  HelpIt

[1] [2] [3] [4]  下一页


[C语言系列][C#防止反编译].NET 产品版权保护方案 (.NET源码加…  [互联动态].NETFramework3.0新特性介绍与问答翻译
[Web开发]asp.net代码空格显示为……点号的原因及解决办法  [Web开发]asp.net调用压缩软件对文件进行压缩与解压缩的代码
[Web开发]详细介绍asp.net获取日期时间的各种格式的函数  [Web开发]如何将JS文件编译到ASP.NET项目里的DLL文件中
[Web开发]asp.net加密口令的最简单方法  [Web开发]目前asp.net开发主流工具软件介绍
[Web开发]asp.net中的反射介绍  [Web开发]制作留言板不使用数据库之asp.net操作XML文件的代…
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台