RAD Studio (Common)
ContentsIndex
PreviousUpNext
Unsafe Code (Delphi for .NET)
Type  
Switch  
Syntax  
{$UNSAFECODE ON} or {$UNSAFECODE OFF}  
Default  
{$UNSAFECODE OFF}  
Scope  
Local  

The $UNSAFECODE directive controls whether the unsafe keyword is accepted by the compiler. With {$UNSAFECODE ON}, you can mark procedures and functions with the unsafe keyword, for example:

procedure unsafeProc; unsafe;
begin
end;

Note: Unsafe code will not pass PEVerify
, nor will any assembly or Delphi module that calls an unsafe procedure or function.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!