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:
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.
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.
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.
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.
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.
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.
Build a cross reference of a MV class for maintenence purposes.
final classmethod camelCaseName(input As %String) as %String
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 Cache class or
property name using Camel Case.
Method designed for use in PROTOCLASS to delete a property and maintain the cross reference.
final classmethod fileDescClassName(fdsc As %MV.File) as %String
Given an open file descriptor in fdsc, this method will suggest a valid name for a
class or other Cache identifier that can be used to name it outside the MV
environment.
final classmethod fileDescDataGlobal(fdsc As %MV.File) as %String
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
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
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.
classmethod newUniqueGlobal(prefix As %String) as %String
Supplies the next avaiable 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.
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
final classmethod setPortNumber(portNo As %Integer) as %Status
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.
final classmethod validCacheName(input As %String) as %String
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 Cache class or
property name.