CHECKVER

Purpose:

Returns 1 if the version of the running program is greater than or equal to the input version.

Syntax:

CHECKVER(majver, minver)

majver

-

An integer. The major version number to check.

minver

-

Optional, an integer. The minor version number to check. Defaults to 1.

Returns:

1 if the version number of the running program equals or exceeds the input version number, else 0.

Example:

if (checkver(2, 2), message(sprintf("Version %s > %d.%d", version(1), 2, 2)))

 

Displays a message if the running version of the program is equal or higher than version 2.2.

Remarks:

CHECKVER is useful for dynamically checking running code that is version dependent. For example, this fragment ensures that a version 6.9 function is only executed if the running program is version 6.9 or higher:

 

if (checkver(6,9))

{

    do_f69_function();

}

else

{

    do_legacy_function();

}

See Also:

VERSION