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

📄 u_int_rtf.pas

📁 This will allow to detect if a file is RTF or not. Use with drag and drop mecanism. Good and simpl
💻 PAS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -