Initializing help system before first use

New functionality for the Mosel language

This module provides the type text for text manipulation. Like the Mosel basic type string, this new type may be generated from all objects that can be converted to a text representation and supports the usual string operations (like concatenation or formatting). In addition, text objects can be generated from structured entities (like arrays or lists); altered (one can get and change a single as well as a sequence of characters in a text); offer a wider set of operations (like insertion/deletion/search of substrings) and, as all module types, are passed by reference to subroutines. Note that this type supports implicit conversion from string: a routine expecting a text as parameter may be used with a string instead (in this case the compiler creates a temporary text from the provided string). When creating a text object from a structured type it is possible to specify a limit on the size of the generated string. For instance if S is a set, text(S,128) will produce a textual representation of S of at most 128 characters.

The type date

As the name suggests, the type date is used to represent a calendar date. Internally, a date is stored as three independent integers for representing the year (-32768 to 32767), the month (-128 to 127) and the day in the month (-128 to 127). The validity of a date can be checked using the function isvalid. A date object can be initialized by a text string, a single or three numerical values. In the first case, the conversion is processed using a predefined date format (see datefmt); in the second case, the integer is interpreted as the number of days elapsed since 1/1/1970; finally, if three integers are used, they are respectively interpreted as the year, month and day for the date. The constant SYS_NOW may also be used to initialize a date: date(SYS_NOW) is the current date. This type also supports assignment, comparison as well as difference (returned in number of days) and addition/subtraction of an integer (number of days).

The type time

The type time is used to represent a time during the day. Internally, a time object is stored as an integer representing a number of milliseconds. A time object can be initialized by a text string or one to four numerical values. In the first case, the conversion is processed using a predefined time format (see timefmt); in the second case, the integer is interpreted as a number of milliseconds. When two to four integers are used, they are understood as the hours, minutes, seconds and milliseconds. The constant SYS_NOW may also be used to initialize a time: time(SYS_NOW) is the current time. This type also supports assignment, comparison as well as difference (returned in number of milliseconds) and addition/subtraction of an integer (number of milliseconds).

The type datetime

The type datetime is used to represent a timestamp by combining a date and a time. A datetime object can be initialized by a text string, a pair date and time or a numerical value. In the first case, the conversion is processed using a predefined time format (see datetimefmt); in the third case, the number is interpreted as the number of seconds elapsed since 1/1/1970 at midnight. If the provided number is a real value, the fractional part is stored as a number of milliseconds. The constant SYS_NOW may also be used to initialize a datetime: datetime(SYS_NOW) is the current date and time. This type also supports assignment, comparison as well as difference (returned in number of seconds) and addition/subtraction of a numerical value (number of seconds).

The type parsectx

This module publishes a set of routines for parsing input text strings (for instance parseint or nextfield). These routines use several module parameters for both their configuration and as a way to record their internal state: a variable of type parsectx may be used as a replacement for these module parameters in order to implement parsing procedures independent of the rest of the program. A single parsectx object integrates endparse (see sys_endparse), sepchar (see sys_sepchar), trim (see sys_trim) and qtype (see sys_qtype). The current value of each of these components can be accessed using the corresponding set and get routine (for instance getendparse).

The type textarea

The textarea type is used by the regular expression matching function regmatch to return locations in the input string. Each text area is defined by a starting position (that is an offset in the original string) and an ending position characterised by the offset of the character following the region to be considered. Functions getstart and getsucc can be used to retrieve these properties.

For instance, the following statement displays the region ta of the text txt:

writeln(copytext(txt,ta.start,ta.succ-1))

This can also be written as follows:

writeln(copytext(txt,ta))

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