Routines (Tools/APIs) Contents Background Information Available Tools Note Work with routines programmatically (create, compile, get time stamp, export, and so on); configure mappings. Background Information You can create routines in ObjectScript. For information, see: Orientation Guide for Server-Side Programming Using ObjectScript You can define routine mappings so that you can access code in a non-default location; see Configuring Namespaces. Typically you do this within the Management Portal. Available Tools ^$ROUTINE This structured system variable returns information about routines.Availability: All namespaces. %RoutineOpens in a new tab class Enables you to read, create, manipulate, save, and compile routines. This class provides methods such as the following: CheckProtect() CheckSyntax() Compile() GetCurrentTimeStamp() Lock() Rewind() RoutineExists() And others It also provides the following queries: Compare() Find() RoutineList() RoutineSortByField() Availability: All namespaces. %RoutineIndexOpens in a new tab class Index for all the routines in this namespace.Availability: All namespaces. %SYSTEM.OBJOpens in a new tab class Includes the following class methods that you can use with routines: CompileList() Export() ExportToStream() Load() Availability: All namespaces. Config.MapRoutinesOpens in a new tab class Enables you to modify and obtain information about the [Map.xxx] section of the CPF, which defines routine mappings. (Note that you usually perform this configuration via the Management Portal, as noted above.)The class also provides the List() class query.The class documentation includes examples and details.Availability: %SYS namespace. %Installer.ManifestOpens in a new tab class and other classes in the %Installer package Enable you to define and use an installation manifest. Among other tasks, you can configure routine mappings.Availability: All namespaces. Note The special variable $SYSTEM is bound to the %SYSTEM package. This means that instead of ##class(%SYSTEM.class).method(), you can use $SYSTEM.class.method().