Initializing help system before first use

# argv

Purpose
Retrieve an argument passed to a model executable.
Synopsis
`function argv(ind: integer):string`
Argument

ind | index of the argument (positive integer)

Return value
Returns as a string the ith argument passed to the command used for executing a model.
Example 1
Consider the following model:

    model mycmd
    uses 'deploy'

    writeln("My arguments:")
    forall(i in 1..argc) writeln(argv(i))
    end-model

Executed with the following command:

    mosel exe mycmd.mos -- -opt 44 mydata

Will produce the following output:

    My arguments:
    mycmd
    -opt
    44
    mydata

Example 2
See examples in Section Deploying models.
Further information
1. This function makes it possible to access the program arguments when a model is run as an executable that has been generated via the deploy.exe I/O driver (see Section Driver exe). The first argument ( i.e. argv(1)) will be the name of the program.
2. If the model is not run as an executable, the first argument will take the name of the model. Additional parameters might be passed to the model using the mosel command by appending them to the command line after the marker ' --' ( e.g. mosel mymodel -- arg1 arg2).
Related topics
argc
Module
deploy
Parent Topic deploy

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