Initializing help system before first use

Upgrading from Mosel 5 to Mosel 6

Topics covered in this section:

The new language features introduced by Mosel 6 are largely incremental to the existing functionality and language syntax. However, a few quite specific points relating to the use of undeclared list or set structures may require updates to existing Mosel source code.

Types of undeclared lists

Mosel 6 allows the user to define lists that contain elements of different types, any such mixed type list now results in a list of any. With previous versions of Mosel a combination of the numerical types real and integer was permitted, resulting in the type list of real.

  1. Constant lists combining types real and integer: In order to obtain the same type list of real with Mosel 6, all integer values need to be cast explicitly to real when defining constant lists of numerical values (LR) or be specified as real numbers (LR2):
    declarations
      LC=[1,2.5]                ! Mosel 5: list of real; Mosel 6: list of any
      LR=[real(1),2.5]          ! Mosel 5+6: list of real
      LR2=[1.0,2.5]             ! Mosel 5+6: list of real
    end-declarations
    As a consequence of the change of type for list LC in the code snippet above, Mosel 5 code accessing elements of this list, such as
    declarations
      myval: real
    end-declarations
    myval:= LC(2)
    will result in an error message "Incompatible types in assignment" with Mosel 6.
  2. Non-constant lists combining types real and integer: For non-constant lists that were previously undeclared and hence relied on the automatic type deduction it will be sufficient to add a suitable declaration:
    declarations
      LD: list of real
    end-declarations
    LA:=[1,2.5]                 ! Mosel 5: list of real; Mosel 6: list of any
    LD:=[1,2.5]                 ! Mosel 5+6: list of real

Unnamed array index sets

Mosel 6 makes it possible to work with unnamed index sets in places where this was previously not possible, including in the definition of arrays that are used as fields in record structures. As a consequence of the revised set handling, a few cases where unnamed sets were already accepted in previous releases now behave in a more systematic way that is different from previous behaviour: unless two arrays specifically are declared to take the same (named) index, their sets are now always treated as being different, including for single line declarations of multiple arrays. As a result, code such as the following that works with previous versions of Mosel:

public declarations
  A,B: array(set of string) of integer
  data=`
data:[('a') [1 2] ('b') [3 4]]
`
end-declarations

initialisations from 'mmsystem.text:data'
  [A,B] as 'data'
end-initialisations

will fail with the error message "Incompatible types for 'initialisations'". The correction consists in adding a name for the set in the array declaration in order to make sure that both arrays have indeed the same index set:

public declarations
  A,B: array(S: set of string) of integer
end-declarations

© 2001-2026 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.