标题:Could not compile used unit 'Unit1.pas'的问题
取消只看楼主
鬼魅幽灵
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-11-20
结帖率:100%
已结贴  问题点数:0 回复次数:0 
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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-279806-1-1.html




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

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