Home > Class Reference > %SYS namespace > %SYSTEM.OBJ.FM2Class

%SYSTEM.OBJ.FM2Class

abstract class %SYSTEM.OBJ.FM2Class extends %SYSTEM.Help

The %SYSTEM.OBJ.FM2Class class provides an interface for mapping FileMan files to InterSystems classes.

You can use it via the special $system object:

  Do $system.OBJ.FM2Class.All(,.count)
  

Method Inventory

Methods

classmethod All(ByRef fmSettings, ByRef classCount As %Integer) [ Language = objectscript ]
Maps all FileMan files in the current namespace to class definitions.

For example:

  Do $System.OBJ.FM2Class.All(.fmSettings,.classCount)
  
classmethod GetVersion() as %Library.String [ Language = objectscript ]
Returns the version of the FM2Class utility
classmethod One(fileNumber As %Numeric = "", ByRef fmSettings, ByRef fmFields, ByRef classCount As %Integer) [ Language = objectscript ]
Maps a single FileMan file in the current namespace to a class definition.

Arguments:

fileNumber = The FileMan File number of the file you want to map to a class

fmSettings = FileMan configuration settings to use for this call. This is an array passed by reference. Defaults for the settings come from the FileMan-to-Class configuration settings.

fmFields = If defined, limits the fields in the file that will be mapped. This is an array of the form fmFields(file-number,field-number). Any required fields and fields defined in this array will be mapped in the class definition. If this array is empty or not defined, all fields in the file will be mapped. This array is passed by reference.

classCount = This parameter is passed by reference and will return a count of the classes created.

Depending on the arguments passed in, this API may actually result in the generate of multiple classes. We might generate reference classes for pointer fields and child classes for Sub-Files/Multiples.

Some examples:

  Set fmSettings("recursion")=0	// Only map this file
  Set fmSettings("display")=1		// Short screen display
  Set fmSettings("logFile")="C:\Map\NEW PERSON.log"
  // Map only the following fields from the "NEW PERSON" file:
  //	NAME, STREET ADDRESS 1, STREET ADDRESS 2, STREET ADDRESS 3
  //	CITY, STATE, ZIP CODE, PHONE (HOME), OFFICE PHONE, EMAIL ADDRESS
  //	(Plus any required fields in the NEW PERSON file)
  For n=.01,.111,.112,.113,.114,.115,.116,.131,.132,.151 { Set fmFields(200,n)=0 }
  Do $System.OBJ.FM2Class.One(200,.fmSettings,.fmFields)
  
  Set fmSettings("compile")=0
  Set fmSettings("recursion")=2
  // Map all fields and all related files for the NEW PERSON file
  Do $System.OBJ.FM2Class.One(200,.fmSettings,,.count)
  Write !,count," classes mapped."
  
classmethod Some(fileList As %String = "", ByRef fmSettings, ByRef fmFields, ByRef classCount As %Integer) [ Language = objectscript ]
Maps a list of FileMan files in the current namespace to a class definition.

Arguments:

fileList = The FileMan File numbers of the files you want to map to a classes. fileList is a comma delimited list of file number or ranges of file numbers.

fmSettings = FileMan configuration settings to use for this call. This is an array passed by reference. Defaults for the settings come from the FileMan-to-Class configuration settings.

fmFields = If defined, limits the fields in the file that will be mapped. This is an array of the form fmFields(file-number,field-number). Any required fields and fields defined in this array will be mapped in the class definition. If this array is empty or not defined, all fields in the file will be mapped. This array is passed by reference.

classCount = This parameter is passed by reference and will return a count of the classes created.

Depending on the arguments passed in, this API may actually result in the generate of more classes that files specified. We might generate reference classes for pointer fields and child classes for Sub-Files/Multiples.

Some examples:

  Set fmSettings("recursion")=0	// Only map this file
  Set fmSettings("display")=1		// Short screen display
  Set fmSettings("logFile")="C:\Map\NEW PERSON and DENTAL.log"
  // Map only the following fields from the "NEW PERSON" file:
  //	NAME, STREET ADDRESS 1, STREET ADDRESS 2, STREET ADDRESS 3
  //	CITY, STATE, ZIP CODE, PHONE (HOME), OFFICE PHONE, EMAIL ADDRESS
  //	(Plus any required fields in the NEW PERSON file)
  // All fields from the DENTAL* files will be mapped
  For n=.01,.111,.112,.113,.114,.115,.116,.131,.132,.151 { Set fmFields(200,n)=0 }
  Do $System.OBJ.FM2Class.Some("200,220:226,727.806",.fmSettings,.fmFields)
  
classmethod Version() as %Library.String [ Language = objectscript ]
Displays the version of the FM2Class utility

Inherited Members

Inherited Methods