Initializing help system before first use

Procedures and functions

In general, the procedures and functions of mmsystem do not fail but set a status variable that can be read with getsysstat. To make sure the operation has been performed correctly, check the value of this variable after each system call.

Add a number of months to a date or datetime.
Compare 2 text strings ignoring case.
Copy a part of a text or string.
Cut a part of a text returning a copy of the deleted string.
Delete a part of a text.
Check whether a text or string ends with a given string.
Securely deletes the content of a text entity.
Expand a path or file name.
Copy a file.
Delete a file.
Search for files according to file name patterns.
Search for a string in a text or string.
Rename or move a file.
Create a text from a format string and its parameters.
Convert a date, time or datetime into a number.
Get a character in a string or text.
Get the current working directory.
Get the date part of a datetime.
Get the day number in the month of a date or datetime.
Get the day number in the year of a date or datetime.
Get the number of days of a month.
Get the directory separator of the running operating system.
Get the value of a control parameter.
Get and set endparse property of a parser context.
Get the value of an environment variable.
Get the size of a file.
Get the status of a file or directory.
Get time information of a file.
Get the hour part of a time or datetime.
Get the minute part of a time or datetime.
Get the month number of a date or datetime.
Get the millisecond part of a time or datetime.
Get the message associated to a system error code.
Get the system error code of the last command.
Get the path separator of the running operating system.
Get and set qtype property of a parser context.
Get the second part of a time or datetime.
Get and set sepchar property of a parser context.
Get the size of a text.
Get and set start property of a text area.
Get and set succ (position of successor character) property of a text area.
Get information about the running operating system.
Get the system status.
Get a time measure or the time part of a datetime.
Get the temporary directory as a text object.
Get and set trim property of a parser context.
Compute the day of the week for a date or datetime.
Get the year part of a date or datetime.
Paste a text or string into a text.
Check whether a date, time or datetime is valid.
Merge elements of a list or set into a text string.
Create a new directory in the given file system.
Create a new directory including its parents if necessary.
Create a Unix tar archive from a list of files.
Create a Zip archive from a list of files.
Advance to next field in a structured text string.
Start an external process for bidirectional communication.
Initialise an object of a module type from a text.
Convert a text into an integer.
Convert a text into a real.
Extract a text from a text.
Paste a text or string into a text.
Check whether a file name matches a given pattern.
Split a path into its components.
Sort a list or an array or (a subset of) the indices of an array.
Quote and encode a text string.
Get the value of a symbolic link.
Read a line of text from the current input stream.
Compare text strings using a regular expression.
Replace portions of a text string based on a regular expression.
Remove a directory.
Remove files selected using file name patterns.
Set a character in a text.
Set the date part of a datetime.
Set the day number of a date or datetime.
Set the value of a control parameter.
Set the value of an environment variable.
Set the hour part of a time or datetime.
Set the minute part of a time or datetime.
Set the month number of a date or datetime.
Set the millisecond part of a time or datetime.
Set the current system error code.
Set the second part of a time or datetime.
Set the time part of a datetime.
Set the year part of a date or datetime.
Suspend execution for a fixed amount of time.
Split a text string.
Check whether a text or string starts with a given string.
Create a symbolic link.
Execute an external program.
Get the list of files included in a Unix tar archive.
Create a formatted text from a string, a text or a number.
Generate the lowercase version of the provided text.
Generate the uppercase version of the provided text.
Remove blank characters at the beginning and/or end of a text string.
Extract files from a Unix tar archive.
Extract files from a Zip archive.
Get the list of files included in a Zip archive.

I/O drivers

The mmsystem module provides two IO drivers: the first one allows to use a string or text object as a file and the second connects a Mosel input or output stream to a program started in a different process. Using this driver, it is possible to get the output of an external program (for instance the result of a preprocessor to feed the Mosel compiler) or implement a basic bidirectional inter process communication thanks to the openpipe procedure (which relies on this IO driver).

Driver text

text:ident

This driver uses a model variable of type string or text as its input or output media. The ident argument it requires is therefore the name of this variable that must be declared globally public to the model or have been published with publish (such that it can always be found independently of the compiler settings).String objects can only be accessed for reading while text entities can be used for both reading and writing.

In the following example the constant string "T" is used as the initialization file for variable "A":

declarations
 public T="A:123"
 A:integer
end-declarations
initializations from "text:T"
 A
end-initializations

Driver pipe

pipe:program [options...]

The file name for this driver is an external program with its options. Options are separated by spaces or tabulations and may be quoted using either single or double quotes. A quoted option may contain any kind of character except the quote used to delimit the string.

When the system opens a pipe, a new process is started for executing the given program and default input and output streams are directed to system pipes. If the file is open for reading (resp. writing), the default ouput stream (resp. input stream) of the new process becomes the current input stream (resp. output stream) of the model. To locate the program to be executed, the system relies on the PATH environment variable. Detection of error (typically the program cannot be found or is not executable) differs depending on the operating system: under Windows, the error is reported immediately and the pipe is not open. With Posix systems, no error is reported but following IO operations fail.

When the file is closed, both input and output streams of the external process are closed then the system waits for its termination: in order to avoid a lock up of the Mosel program one must make sure that the external program ends its execution when default input and output streams are closed.

Example: the following command could be used with Mosel Console for compiling the model mymod.mos after it has been processed by the C preprocessor. Note that we have to provide an output file name since the compiler cannot deduce it from the source file name.

For a Posix systems:

compile 'mmsystem.pipe:cpp mymod.mos' '' mymod.bim

For Windows (with MSVC):

compile 'mmsystem.pipe:cl /E mymod.mos' '' mymod.bim

When Mosel is running in restricted mode (see Section mosel command: restricted mode), this driver behaves like the system procedure.

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