Stata 11 help for mf_stataversion

help mata stataversion() -------------------------------------------------------------------------------

Title

[M-5] stataversion() -- Version of Stata being used

Syntax

real scalar stataversion()

real scalar statasetversion()

void statasetversion(real scalar version)

Note: the version number is multiplied by 100: Stata 2.0 is 200, Stata 5.1 is 510, and Stata 13.0 is 1300.

Description

stataversion() returns the version of Stata/Mata that is running, multiplied by 100. For instance, if you have Stata 13 installed on your computer, stataversion() returns 1300.

statasetversion() returns the version of Stata that has been set by the user -- the version of Stata that Stata is currently emulating -- multiplied by 100. Usually stataversion() == statasetversion(). If the user has set a previous version -- say, version 8 by typing version 8 in Stata -- statasetversion() will return a number less than stataversion().

statasetversion(version) allows you to reset the version being emulated. Results are the same as using Stata's version command. version, however, is specified as an integer equal to 100 times the version you want.

Remarks

It is usually not necessary to reset statasetversion(). If you do reset statasetversion(), good form is to set it back when you are finished:

current_version = statasetversion() statasetversion(desired_version) ... statasetversion(current_version)

Conformability

stataversion(): result: 1 x 1

statasetversion(): result: 1 x 1

statasetversion(version) version: 1 x 1 result: void

Diagnostics

statasetversion(version) aborts with error if version is less than 100 or greater than stataversion().

Source code

Functions are built in.

Also see

Manual: [M-5] stataversion()

Help: [M-5] bufio(); [M-5] byteorder(); [M-4] programming


© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index