Show/Hide Toolbars

XSharp

Purpose

The BEGIN UNSAFE and END UNSAFE keyword pairs declare a scope of code that contains unsafe statements, such as typed pointers.

Syntax

BEGIN UNSAFE
  statements
END UNSAFE

Arguments

statements Code including one or more statements that may contain unsafe code.

 

Example

 

FUNCTION Start() AS VOID
LOCAL a AS INT[]
a := <INT>{1,2,3,4,5}
                   
BEGIN UNSAFE
  LOCAL p AS INT PTR
  p := @a
  FOR VAR i := 1 to 5
     ? p[i]
  NEXT
END UNSAFE
RETURN