NewDeviceRef

Purpose

This function creates a new device and gives it the specified name.  The new device has the house code and unit code set to "A1", and all other attributes of the device are cleared.  The device has no module type and has no location.  Unlike NewDevice, this returns the unique device reference ID instead of an index, which makes this procedure more reliable during times of devices being added and removed by other scripts and plug-ins.

Parameters

Parameter: name
Type: string
Description: This is the name of the new device.

Returns

Return value: device reference
Type: long
Description: This is the device reference ID of the device that may be used in subsequent calls to the GetDeviceByRef function.