ptr

Attempts to converts a given value into a pointer.

Syntax:

ptr(n);


Argument Description
n The value to convert.


Returns: Pointer


Description

This function will attempt to convert a given value into a pointer data type, where the value must be either a real, a string, an int64, an int32, or a ptr. Anything else will cause the game to crash with an error message.


Example:

if !is_ptr(val)
   {
   val = ptr(application_surface);
   }

The above code checks the variable "val" to see if it contains a pointer and if it does not then one is assigned to it.


Back: Data Types
© Copyright YoYo Games Ltd. 2018 All Rights Reserved