Skip to main content


stream class %MV.StudioRoutines extends %Studio.AbstractDocument

Method Inventory


method CompileDocument(ByRef qstruct As %String) as %Status
Compile the routine
classmethod Delete(name As %String) as %Status
Delete the routine 'name' which includes the routine extension
classmethod Exists(name As %String) as %Boolean
Return 1 if the routine 'name' exists and 0 if it does not.
classmethod GetOther(name As %String) as %String
Return other document types that this is related to
classmethod ItemList(Idx As %Integer, Ext As %String, ByRef Work As %String, Start As %String, End As %String, Directory As %String, Sort As %Integer, System As %Boolean, Flat As %Boolean, ShowGenerated As %Boolean, ByRef NewFormat As %Boolean) as %Status
Inherited description: This method ties into the open dialog in Studio. It is passed a list of information based on the search criteria from the user and it should populate the ^||%RoutineList(Idx) global with the items it wishes to show in the following format:


  • Idx - The index provided in the 'Idx' parameter
  • dirtype - This is 1 if this is a regular openable item and 0 if this is a directory so that directories show up before the other items in the open dialog
  • order - The value based on the sorting order of items, e.g. size or date/time last modified, more information on this below
  • index - An integer index to prevent multiple items with for example the same size from over writing each other.
  • name - The name to display in the open dialog
  • dirsymbol - The symbol to use to navigate directories, for regular items this is "" but for directories this should be the character to append to the directory in order to browse into this directory. Do not use '/' or '\' as these are reversed for CSP files
  • type - This is an integer version of the type of the item, see the list below for details
  • size - The size of this item as an integer
  • date/time - The date/time this item was last modified in %TimeStamp format, or "" if not known

The type of the item which can be one of:

  • 0 - MAC file, a routine containing macros
  • 1 - INT file, a standard routine
  • 2 - INC file, an include file
  • 3 - BAS file, a Cache Basic routine
  • 4 - CLS, a class
  • 5 - CSP, a Cache Server Page or another file in this directory
  • 7 - GBL, a Global
  • 8 - PRJ, a Project
  • 9 - a Package
  • 10 - a CSP application
Further numbers are reserved for future use. User defined items should start at 100.

order is one of:

  • 1 - Name of the file non case sensitive (the default)
  • 2 - Date/Time the file was saved
  • 3 - Size of the file
  • 4 - Type of the file i.e. the number from the 'type' list
  • 5 - Name of the file (case sensitive)

The arguments to this method are:

  • Idx - Index into ^CacheTemp to write data
  • Ext - Extension name we are processing
  • Work - Array of pattern match information that we test each item against, root node is $listbuild(mapped) so you can see if we want to return mapped items
  • Start - First possible match, can be used to optimise the query
  • End - Last possible match, can be used to optimise the query
  • Directory - The directory name we are searching
  • Sort - The entry to sort by, same as the list for 'order'
  • System - If true then include the '%' routines/classes
  • Flat - If true then flatten directories to return items inside them, this is used by the 'Namespace' tab in Studio to display all items in the system
  • ShowGenerated - If false then do not show items generated from something else, e.g. do not show TEST.INT if this is compiled from TEST.MAC
  • NewFormat - Returned by reference, if set to true use the new ^||%RoutineList format, else caller will convert output to the new format
method Load() as %Status
Load the document
classmethod OpenProgramFile(ByRef sourceFileObj, ByRef prog As %String, name As %String, createFlg As %Boolean) as %Status
method Save() as %Status
Save the routine stored in Code
classmethod TimeStamp(name As %String) as %TimeStamp
Return the timestamp of routine 'name' in %TimeStamp format. This is used to determine if the routine has been updated on the server and so needs reloading from Studio. So the format should be $zdatetime($horolog,3), or "" if the routine does not exist.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab