« Back to Product

Documentation

IPS_GetLinkIDByName

Require: IP-Symcon >= 2.1

 int IPS_GetLinkIDByName (string $LinkName, int $ParentID) 

Parameters

LinkName

Name of the link

ParentID

Object whose children are searched

Returns

ID of the found link otherwise FALSE

Description

The command tries to determine the ID of the link called LinkName, whose parent has the ID ParentID. It will use the ID of the first found link whose name matches with LinkName. If such a link was found, its ID is returned, otherwise FALSE.

Warning

Caution: Names in IP-Symcon can be chosen freely, so they are not unique. For this reason, the command can return a false ID.

Warning

This function generates a warning if the name was not found. Use the @ operator, if you want to suppress this message. The exact function of this operator you can look up in the PHP manual.

Example

$LinkID = @IPS_GetLinkIDByName("Linked rain sensing", $ParentID);
if ($LinkID === false)
    echo "Link not found!";
else
    echo "The Link ID is: ". $LinkID;
Any questions?