%SYSTEM.MV
Class %SYSTEM.MV Extends Help [ Abstract, System = 4 ]
The class %SYSTEM.MV provides access to MV system level functions and elements for COS and MVBASIC programmers.
This class should always be used in preference to direct access to the internals of the MV implementation, as it is guranteed to be in sync with any underlying structural changes.
NEVER try to access MV elements at their base system level as upward compatiblity is not guranteed and this can in fact be dangerous.
COS language methods and programs should access this class using the special $System object: Set cosName = $System.MV.validCacheName("MVFILE.$TRANGEN4M3")
MVBASIC programmers should access this class using the "%SYSTEM.MV" method: cosName = "%SYSTEM.MV"->validCacheName("MVFILE.$TRANGEN4M3")
Methods
TCL2Next
ClassMethod TCL2Next() As %Integer [ Final ]
Call this method to get the next Item ID from the TCL II processed command line.
Note that you can enable TCL II (list, vs *, vs itemidlist) processing for an MVBASIC cataloged program by editing the CATALOG pointer for the program and adding '2' to Attribute 5:
MYNEWVERB 0001 V 0002 MVB.3�%SYS 0003 B 0004 0005 2 0006 0007 L 0008 MYNEWVERB 0009 BP 0010 SYSPROG
You can additionaly add the the following letters to attribute 5:
'C' - will cause the item body to be copied into @RECORD.
'N' - will allow new items and not check for an item's existence.
'D' - will force an open of the DICT rather than DATA section.
Returns:
1 - Success. The next Item Id has been placed in @ID and optionally the body has been copied into @RECORD
0 - End of Items or failure.
parseDict
ClassMethod parseDict(dict As %MV.File, record As %String, name As %String) [ Final ]
Parses the supplied DICT entry record as element name into the public variable %dictionary using the open dict file variable if it needs to reference other elements in the DICT. If the method returns 0, then you can just exit your program and the MV shell will display any ERRMSG that has occurred.
Returns: | nnn | - Ordinal entry number in %dictionary |
---|---|---|
0 | - Could not open DICTionary or other error |
buildMVClassXref
ClassMethod buildMVClassXref(classDef As %ObjectHandle, ByRef ClassXref As %Collection.AbstractArray) [ Final ]
Build a cross reference of a MV class for maintenence purposes.
createMVProperty
ClassMethod createMVProperty(pname, pord, classDef As %ObjectHandle, ByRef ClassXref As %Collection.AbstractArray) [ Final ]
Method designed for use in PROTOCLASS to generate a property defined by the MV DICT item that has been parsed and stored in %dictionary(pord)
deleteMVProperty
ClassMethod deleteMVProperty(pname, classDef As %ObjectHandle, ByRef ClassXref As %Collection.AbstractArray) [ Final ]
Method designed for use in PROTOCLASS to delete a property and maintain the cross reference.
fileDescClassName
ClassMethod fileDescClassName(fdsc As %MV.File) As %String [ Final ]
Given an open file descriptor in fdsc, this method will suggest a valid name for a class or other ObjectScript identifier that can be used to name it outside the MV environment.
setPortNumber
ClassMethod setPortNumber(portNo As %Integer) As %Status [ Final ]
Given a port number supplied by the caller, this function will set the current port number for this process. Should be called early on in the start up of the process for predictability, but can be called any time in practice.
fileDescDataGlobal
ClassMethod fileDescDataGlobal(fdsc As %MV.File) As %String [ Final ]
Given an open file descriptor, this method will return the fully qualified name of the global that stores the data.
Fully qualified means that it includes the NAMESPACE (account) within it such as ^|"TESTACCOUNT"|JIM.DATA
validCacheName
ClassMethod validCacheName(input As %String) As %String [ Final ]
Given an MV identifier name of some sort in input, such as a file name this method will return a name that is valid as a class or property name.
camelCaseName
ClassMethod camelCaseName(input As %String) As %String [ Final ]
Given an MV identifier name of some sort in input, such as a file name this method will return a name that is valid as a class or property name using Camel Case.
decomposeStatus
ClassMethod decomposeStatus(sc As %Integer) [ Final ]
If an error occurred in a call to an object or class, you can call this method and it will PRINT the error messages to the terminal.
newUniqueGlobal
ClassMethod newUniqueGlobal(prefix As %String) As %String
Supplies the next available unique global name using the same mechanisms as CREATE-FILE. Calling this will reserve a global name for you that is guranteed to be exclusive for your use. Note that the name returned does not include any namespace information and is unique across namespaces too. It is up to you to decide where (namespace wise) the global will exist.
getPrimaryMVClass
ClassMethod getPrimaryMVClass(fdsc As %MV.File, createFlg As %Boolean, NewName As %String = "") As %ObjectHandle [ Final ]
Given an open file descriptor, this method will return the class associated with that file.
If createFlg is set then the class will be created if it doesn't exist.
If NewName is specified then that name willl be used to create the class.
InputDataOnly
ClassMethod InputDataOnly(DataOnlyFlag As %Boolean) As %Boolean
This method sets or clears a flag that controls whether INPUT commands will read only stacked DATA or will also read from the input device. The argument is a boolean value 0 or 1. If DataOnlyFlag is 1, only stacked DATA will be available to INPUT commands. An attempt to read beyond the stacked DATA will result in an ABORT. If DataOnlyFlag is 0, the Data Only flag is cleared and INPUT commands will return to the default state of reading both stacked DATA and directly from the input device.
The return value is the previous state of the flag. If no argument is given, the current state of the flag is returned without changing it.
generateItypeMethods
ClassMethod generateItypeMethods(classDef As %ObjectHandle)
This method will search a class for properties that are defined as itypes and add implementations of the calc and calcsql metods for those itypes to the class
StackSetCOS
ClassMethod StackSetCOS(arg As %String = "") As %Boolean
Set the passed string as the COS shell recall stack
StackSetMV
ClassMethod StackSetMV(arg As %String = "") As %Boolean
Set the passed string as the MV shell recall stack
StackGetCOS
ClassMethod StackGetCOS() As %String
Get the COS shell recall stack
StackGetMV
ClassMethod StackGetMV() As %String
Get the MV shell recall stack
IteratorInit
ClassMethod IteratorInit()
The Initializer for iterating through values and subvalues in conjunction with A and F correlatives. This clears the moreValues and moreSubValues flags and sets the current value and current subvalue counters to 1.
IteratorTest
ClassMethod IteratorTest() As %Boolean
The method tests to see if there are more values to process as indicated by the moreValues and moreSubValues flags and sets the current value and current subvalue counters accordingly. These flags and counters are used by the Conversion Processor to handle multi-values in A and F correlatives.
IteratorGet
ClassMethod IteratorGet(attrNo As %Integer) As %String
The method gets contents of the specified attribute, current value, current subvalue from @Record. Use to Iterate through all the (sub)values in conjunction with A or F correlatives. If the specific attr,val,subval does not exist then the funtion will return an empty string.
ConvAnalyze
ClassMethod ConvAnalyze(code As %String) As %String
The method passes a string to the conversion code compiler, checks for errors and returns a string of information. The returned string is a series of comma separated numbers:
1. Status code:
Negative value is a negated errmsg number.
Positive value is data type of result.
0 Unknown
1 String
2 Integer
3 Numeric
4 Boolean
2. Bit values that show the types of computational codes found.
1 Contains an A correlative
2 Contains an F correlative
4 Contains a Concatenate Correlative
8 Contains a Substitute Correlative
16 Contains a Call or B; Correlative invoked for each value
32 Contains a Call or B: Correlative invoked once for an attribute
3+. If present, shows attributes referenced in the conversion code.