DADiSP Worksheet Functions > Function Categories > Operating System Interface > COMMAND LINE FLAGS

 

COMMAND LINE FLAGS

Purpose:

Sets run-time options specified on the OS command line.

 

DADiSP supports a number of command line flags invoked on startup to control the initial behavior. A command line flag begins with a leading - or / character followed by an optional = to specify arguments. For example, if the name of the DADiSP executable is dadispnt.exe, then

 

dadispnt -d=2

 

sets the initial display size to maximized.

 

Multiple command line flags may be specified.

 

 

Display Options

 

Options that determine the initial display mode.

 

-d=0

hidden

-d=1

normal

-d=2

maximized

-d=3

iconic

 

Running DADiSP in hidden mode (-d=0) is useful when using DADiSP as an analysis engine in conjunction with another program.

 

 

Data Options

 

Options that determine the initial Labbook and Worksheet.

 

-l=labbookpath

open a specific Labbook

-w=worksheetname

open a specific Worksheet

 

If labbookpath or worksheetname contains spaces, it should be enclosed in quotes. For example:

 

dadispnt -w="C:\Documents and Settings\users\My Documents\MyWork.dwk"

 

If worksheetname does not refer to a DWK and labbookpath is not specified, the Worksheet must reside in the current Labbook.

 

Command File and SPL Options

 

Options that specify loading of SPL functions.

 

-c=comfilename

load and run a command file

-s=splname

load and run an SPL function

-x=splname

load and run an SPL function with the display hidden and exit upon completion

 

For example:

 

dadispnt -c=demo.dsp

 

loads and runs the DADiSP demo script.

 

A command line SPL function can accept arguments. For example, consider the following SPL function named ctest.spl:

 

// ctest.spl
ctest(n, m)
{
    if (argc < 2)
    {
        if (argc < 1) n = 2;
 
        m = n;
    }
 
    newworksheet(2, 0);
 
    eval(sprintf("W2 := randn(%d, %d)", n, m));
}

 

Invoking:

 

dadispnt -s=ctest

 

creates a 2 window worksheet, sets the formula of W2 to randn(2, 2) causing W2 to contain a 2x2 array of random values.

 

dadispnt -s=ctest(10)

 

creates a 2 window worksheet, sets the formula of W2 to randn(10, 10) causing W2 to contain a 10x10 array of random values.

 

If multiple arguments are specified, enclose splname in quotes. For example:

 

dadispnt -s="ctest(10, 5)"

 

same as above except the formula of W2 is randn(10, 5) and contains a 10x5 random array.

 

Single and double quotes can be used for string arguments. For example:

 

 

// ctest2.spl
ctest2(n, title)
{
    if (argc < 2)
    {
        if (argc < 1) n = 2;
 
        title = "Test";
    }
 
    newworksheet(2, 0);
 
    eval(sprintf("W2 := randn(%d)", n));
 
    label(W2, title);
}

 

Now,

 

dadispnt -s=ctest2(10)

 

creates a 2 window worksheet, sets the formula of W2 to randn(10) causing W2 to contain a 10x10 array of random values. W2 is labeled with the text Test.

 

dadispnt -s="ctest2(10, 'My Label')"

 

same as above except W2 is labeled with the text My Label.

 

 

ActiveX Options

 

Options that specify ActiveX capabilities.

 

-a

run as automation server

-e

run as embedded server

-register

register as an ActiveX server

-unregister

unregister as an ActiveX server

 

The -a and -e options are specified together when embedding DADiSP into another application.

 

 

Configuration Options

 

Options that specify configuration settings.

 

-cnf=configfile

load a session specific configuration file

 

The standard configuration file named dadisp.cnf is loaded first, then any runtime settings are loaded from the session file dadisp.ses and finally the settings specified in the command line configuration file are loaded. In this way, the command line settings can override the initial base and runtime settings.

 

 

Miscellaneous Options

 

Additional  options.

 

-password

display password request dialog if password required

-version

display version information and exit

 

 

Alphabetical Listing

 

A summary of all command line flags listed in alphabetical order.

 

-a

run as ActiveX automation server

-c=comfilename

load and run a command file

-cnf=configfile

load a session specific configuration file

-d=0

display hidden

-d=1

display normal

-d=2

display maximized

-d=3

display iconic

-e

run as embedded ActiveX server

-l=labbookpath

open a specific Labbook

-password

display password request dialog if necessary

-register

register as an ActiveX server

-s=splname

load and run an SPL function

-unregister

unregister as an ActiveX server

-version

display version information and exit

-w=worksheetname

open a specific Worksheet

-x=splname

load and run an SPL function with the display hidden and exit upon completion