File-Type Unit

The code of the file-type unit

unit File_type;
{
    Copyright (c) 2013 Jerzy Griffiths

    Licensed under the Apache License, Version 2.0 (the "License"); you may not
    use this file except in compliance with the License, as described at
    http://www.apache.org/licenses/ and http://www.pp4s.co.uk/licenses/ }
 
interface

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

type
  TFile_Type_frm = class(TForm)
    Label1: TLabel;
    Novel_Memo: TMemo;
    Label2: TLabel;
    Playscript_rdbtn: TRadioButton;
    General_file_rdbtn: TRadioButton;
    Coursework_rdbtn: TRadioButton;
    Playscript_memo: TMemo;
    Label3: TLabel;
    Memo1: TMemo;
    Memo2: TMemo;
    Create_btn: TButton;
    Novel_rdbtn: TRadioButton;
    procedure Novel_rdbtnClick(Sender: TObject);
    procedure Playscript_rdbtnClick(Sender: TObject);
    procedure General_file_rdbtnClick(Sender: TObject);
    procedure Coursework_rdbtnClick(Sender: TObject);
    procedure Create_btnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  File_Type_frm: TFile_Type_frm;
  TypeOfFile: integer = 1;

implementation

uses Main_menu, Novel, playscript, general, coursework;

{$R *.dfm}

procedure TFile_Type_frm.Coursework_rdbtnClick(Sender: TObject);
begin
  TypeOfFile := 3;
end;

procedure TFile_Type_frm.Create_btnClick(Sender: TObject);
begin
  case TypeOfFile of
    1:
    begin
      novel_frm.Show;
      file_type_frm.hide;
    end;
    2:
    begin
      Playscript_frm.Show;
      file_type_frm.hide;
    end;
    3:
    begin
      coursework_frm.Show;
      file_type_frm.hide;
    end;
    4:
    begin
      general_frm.Show;
      file_type_frm.hide;
    end;
  end;
end;

procedure TFile_Type_frm.General_file_rdbtnClick(Sender: TObject);
begin
  TypeOfFile := 4;
end;

procedure TFile_Type_frm.Novel_rdbtnClick(Sender: TObject);
begin
  TypeOfFile := 1;
end;

procedure TFile_Type_frm.Playscript_rdbtnClick(Sender: TObject);
begin
  TypeOfFile := 2;
end;

end.
Programming - a skill for life!

by Jerzy Griffiths: L6 Age ~17