Cicode Programming Reference > Cicode Function Categories > Display Functions > DspGetAnFromName

DspGetAnFromName

Name used to retrieve the AN of an object on the page. Use the following relative path syntax:

[RelativePath].[Group].[Group].Control

This will browse the group hierarchy to a specific starting point, and then drill down to other groups to find the named control or object.

If you do not use a relative path the system will first look for an object within the groups specified relative to the object the cicode is running on, and if the name is not found, it will then search the page for the first existence of the object name. See Referencing an object using a name at runtime for more information.

Note: When retrieving the AN for an object within a genie or super genie you need to use a relative path.

Syntax

DspGetAnFromName(sName)

sName

The Name of the object used as a reference for the AN.

Return Value

AN of object or -1 if not found.

Related Functions

DspAnSetName, DspGetNameFromAn

Example

// Example of relative pathing syntax
// Reference from a current group, symbol or genie
DspGetAnFromName(".\Object1")
// Navigate three levels up and from the root level search for Object1.
DspGetAnFromName("..\..\..\Object1")
				

See Also

Published June 2018