Skip to content
Adám Brudzewsky edited this page May 6, 2019 · 12 revisions

The Link API functions are normally found in ⎕SE.Link. All API functions take a character vector or vector of vectors as a right argument, and optionally a namespace containing option values on the left. For more details on setting options, look below the table:

Link API Function reference

Function Right Argument(s) Options Result
Add items filename
Break namespace
CaseCode filename case-coded filename
Create namespace directory source watch [and many more]
Export namespace directory
Expunge items
Fix source larg: ns name oldname
GetFileName item
GetItemName filename itemname
Import namespace directory
List [namespace]
Notify event filename oldfilename
Refresh namespace

Option Namespaces

API functions take a primary argument on the right which is a simple character vector or a vector of vectors as documented above. With the exception of Fix, which takes a 3-element left argument, API functions typically accept an option namespace as the left argument. For example, to create a link with non-default source and flatten options, you would write:

      options⎕NS ''                                     create empty namespace
      options.(source flatten)'dir' 1                   set two named options
      options ⎕SE.Link.Create 'myapp' '/sources/myapp'   namespace and director name on the right, options on left

User commands

Most, but not all, API functions have a corresponding user command, to make them a little easier to use interactively. These user commands all take exactly the same arguments and options as the API functions, specified using user command syntax. The Link.Create call above would thus be written:

      ]LINK.Create myapp /sources/myapp -source=dir -flatten

Specifying extensions: Two options require arrays identifying file extensions: codeExtensions and typeExtensions. For convenience, the ]Link.Create user command accepts the name of a variable containing the array, rather than the array values. However, in this case, is highly recommended to use the API function directly rather than the user command.

Clone this wiki locally