cpmem.pas

来自「生物信息学中的遗传数据分析的delphi源码。」· PAS 代码 · 共 42 行

PAS
42
字号
{*******************************************************************
*                                                                  *
*  COMPONENT for MS DOS and Windows source code.                   *
*                                                                  *
*  (c) 1992, Roderic D. M. Page                                    *
*                                                                  *
*  Language: Turbo Pascal (Pascal with object-oriented extensions) *
*  Compiler: Turbo Pascal 6.0 (MS DOS)                             *
*            Turbo Pascal for Windows 1.0 (WINDOWS)                *
*                                                                  *
*  Notes:    Program interface is currently Windows specific.      *
*                                                                  *
*******************************************************************}

{$I CPDIR.INC}

unit cpmem;

{Install a heap error function. }

interface

   function HeapFunc(Size: WORD):INTEGER;
      {Set Turbo Pascal system variable HeapFunc to 1,
       so that the procedures <\i New> and <\i GetMem> return
       <\b nil> when they cannot allocate memory.

       See TPW 1.0 Programmer's Guide, pp. 195-197.
       }

implementation

{$F+}
function HeapFunc(Size: WORD):INTEGER;
begin
  HeapFunc := 1;
end;
{$F-}

begin
   HeapError := @HeapFunc;
end.

⌨️ 快捷键说明

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