| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2739 人关注过本帖
标题:Could not compile used unit 'Unit1.pas'的问题
只看楼主 加入收藏
鬼魅幽灵
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-11-20
结帖率:100%
收藏
已结贴  问题点数:0 回复次数:2 
Could not compile used unit 'Unit1.pas'的问题
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TKeyGen = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  KeyGen: TKeyGen;

implementation

{$R *.dfm}

procedure TKeyGen.Button1Click(Sender: TObject);

  function KeyGen(Name: string): string;
var
      n, tmp, Len: integer;
      res: string;
begin
      Len := Length(Name);
      if Len < 6 then

      begin
          Result := '用户名太短...';
          exit;
      end;
      if Trim(Name) <> Name then
      begin
          Result := '用户名前后不能含空格';
          exit;
      end;
      Name := UpperCase(Name);
      for n := 1 to Len do
      begin
          if n mod 2 = 0 then
              tmp := n * 3 + ord(Name[n])
          else
              tmp := n * (-3) + ord(Name[n]);
          if (tmp < $30) then
              res := res + '@'
          else if (tmp > $69) then res := res + '*'
          else
              res := res + Chr(tmp);
      end;
      Result := res;

end;
=====================
错误

[Error] Unit1.pas(83): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

看看错在哪里?
搜索更多相关主题的帖子: compile Could used unit not 
2009-07-19 12:09
lg5277
Rank: 2
等 级:论坛游民
帖 子:3
专家分:26
注 册:2009-7-11
收藏
得分:21 
最后的END后是点号吧,不是分号,没仔细看,差不多
2009-07-19 13:09
chengjianxin
Rank: 2
等 级:论坛游民
帖 子:9
专家分:10
注 册:2008-10-28
收藏
得分:0 
这个是因为的Delphi过期导致的,用注册码生成器重新注册一下,实在不行就彻底重新安装
2009-07-21 23:32
快速回复:Could not compile used unit 'Unit1.pas'的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014349 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved