u_int_rtf.pas

来自「This will allow to detect if a file is R」· PAS 代码 · 共 51 行

PAS
51
字号
unit U_Int_RTF;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormShow(Sender: TObject);
  private
    { D閏larations priv閑s }
  public
    { D閏larations publiques }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

VAR
  F : FILE ;
  S : ARRAY [0..10] OF CHAR ;
  P : PCHAR ;

procedure TForm1.FormShow(Sender: TObject);
begin
IF paramCount <> 1 THEN
  Label1.Caption := 'Pas de fichier en entr閑'
ELSE
  BEGIN
  AssignFile (F, ParamStr (1)) ;
  Reset (F, 1) ;
  BlockRead (F, S [0], 6) ;
  CloseFile (F) ;
  P := @(S [0]) ;
//  ShowMessage (P) ;
  IF (S [0] = '{') AND (S [1] = '\') AND (S [2] IN ['r', 'R']) AND (S [3] IN ['t', 'T']) AND (S [4] IN ['f', 'F']) THEN
    Label1.Caption := 'OUI'
  ELSE
    Label1.Caption := 'Apparement pas !'
  END;
end;

end.

⌨️ 快捷键说明

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