⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit3.pas

📁 旅游查询系统
💻 PAS
字号:
unit Unit3;

interface

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

type
  TForm3 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Memo1: TMemo;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation


{$R *.dfm}
FUNCTION  places(i:integer):string;
BEGIN
    CASE i OF
        1:places:='北京';
        2:places:='上海';
        3:places:='广州';
        4:places:='哈尔滨';
        5:places:='大连';
        6:places:='天津';
        7:places:='西安';
        8:places:='郑州';
        9:places:='杭州';
        10:places:='成都';
        11:places:='桂林';
        12:places:='拉萨';
    END
END;

procedure TForm3.Button2Click(Sender: TObject);
begin
      Close;
      Edit1.Text:='';
      Memo1.Text:='';
end;

procedure TForm3.Button1Click(Sender: TObject);
VAR  foundpassenger:string;
     i,j,foundtime:integer;
begin
     foundpassenger:=Edit1.Text;
     foundtime:=720*(strtoint(Form2.Label8.Caption))+(24*strtoint(Form2.Label9.Caption))+strtoint(Form2.Label10.Caption);
     i:=1;
     WHILE ((passageinformation[i].passagename<>'')AND(passageinformation[i].passagename<>foundpassenger))  DO
          i:=i+1;
     IF  passageinformation[i].passagename='' THEN
        BEGIN
        memo1.Lines[0]:='对不起,没有你查询旅客的信息,请核实旅客姓名!' ;
            memo1.Lines[1]:='';
        END
            ELSE
                BEGIN
                    Memo1.Lines[0]:='现在时间是'+Form2.Label7.Caption+'年'+Form2.Label8.Caption+'月'+Form2.Label9.Caption+'日'+Form2.Label10.Caption+'时';
                    IF foundtime-passageinformation[i].searchtime>=passageinformation[i].spendtime THEN   memo1.Lines[1]:='该旅客已经到达目的地'+places(passageinformation[i].arrivalplace)
                        ELSE  memo1.Lines[1]:='该旅客正在从'+places(passageinformation[i].departplace)+'到'+places(passageinformation[i].arrivalplace)+'的途中'
                END;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -