Introduction
The xreflect module allows a package to programatically access Mosel entities whose names and types were not known at compile-time. For example, this allows a developer to write a function to increment each value in a named array by 1, regardless of the type or index sets of the array.
Limitations
xreflect can only operate on entities of the following types:
- boolean
- integer
- real
- string
- set of boolean
- set of integer
- set of real
- set of string
- array of boolean
- array of integer
- array of real
- array of string
Additionally, xreflect can only access entities declared as public, for example in a public declarations block.:
public declarations myArray: array(range) of string end-declarations
Namespace
All types and subroutines exported by the xreflect module are part of the xreflect namespace; your model or package will need to reference this namespace in order to use this functionality. For example:
model myModel uses 'xreflect' nssearch xreflect public declarations myArray: array(range) of string end-declarations writeln('Type of values in myArray: ',getvaluetype('myArray')) end-model
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.