Command Reference : Programming Language Reference
  
Programming Language Reference
The following reference is an alphabetical listing of the program statements and support functions used by the EViews programming language.
For details on the EViews programming language, see “EViews Programming”.
Programming Summary
Program Statements
call calls a subroutine within a program.
else denotes start of alternative clause for IF.
endif marks end of conditional commands.
endsub marks end of subroutine definition.
exitloop exits from current loop.
for start of FOR execution loop.
if conditional execution statement.
include include subroutine in programs.
next end of FOR loop.
return exit subroutine.
sleep pause program.
step (optional) step size of a FOR loop.
stop halts execution of program.
subroutine declares subroutine.
then part of IF statement.
to upper limit of FOR loop.
wend end of WHILE loop.
while start of WHILE loop.
Support Commands
addin register a program file as an EViews Add-in.
clearerrs sets the current program error count to 0.
commandcap send text to the command capture window.
exec execute a program.
logclear clears the log window of a program.
logmode sets logging of specified messages.
logmsg adds a line of text to the program log.
logsave saves the program log to a text file.
open opens a program file from disk.
output redirects print output to objects or files.
poff turns off automatic printing in programs.
pon turns on automatic printing in programs.
program declares a program.
run runs a program.
saveprgini saves program variables in“.ini” file .
seterr sets a user-specified execution error.
seterrcount sets the current program execution error count.
setmaxerrs sets the maximum number of errors that a program may encounter before execution is halted.
statusline sends message to the status line.
tic reset the timer.
toc display elapsed time (since timer reset) in seconds.
xclose close an open connection to an external application.
xget retrieve data from an external application into an EViews object.
xlog switch on or off the external application log inside EViews.
xoff turns off mode that sends all subsequent command lines to the external program
xon turns on mode that sends all subsequent command lines to the external program
xopen open a connection to an external application.
xpackage installs the specified R package in the current external R connection
xput send an EViews object to an external application.
xrun run a command in an external application.
Support Functions
@addinspath string containing the EViews add-ins directory path.
@attrnames string containing a list of current workfile attribute names.
@attrvals string containing a list of current workfile attribute values .
@datapath string containing the current EViews data directory.
@date string containing the current date.
@equaloption returns the string to the right of the “=” in the specified option provided in the exec or run command.
@errorcount number of errors encountered.
@evpath string containing the directory path for the EViews executable.
@fileexist checks for existence of a file on disk.
@folderexist check for a folder’s existence on disk
@getnextname string containing next available name in the workfile.
@getthistype returns the object type of _this .
@hasoption returns 1 or 0 for whether the specified option was provided in the exec or run command.
@isobject checks for existence of object.
@isvalidgroup checks whether a string represents a valid expression for creating an EViews group or auto-series.
@isvalidname checks whether a string represents a valid name for an EViews object.
@lasterrnum the error number for the previously issued command.
@lasterrstr string containing the error text for the previously issued command.
@linepath string containing the location of the program currently being executed.
@loadprgini string containing the contents of a specified name in an“.ini” file .
@makevalidname string containing an uppercased valid EViews name based on the input.
@maxerrcount the maximum number of errors that a program may encounter before execution is halted.
@option returns the i-th option string provided in the exec or run command.
@runpath returns a string containing the location of the program currently being executed.
@tablenames space delimited string containing the tables names in a foreign file.
@temppath string containing the directory path for EViews temporary files.
@time string containing the current time.
@toc calculates elapsed time (since timer reset) in seconds.
@vernum scalar containing the EViews version number.
@verstr string containing the EViews product name string.
@wdir string list of all files in a directory.
@wfattrnames string containing a list of attribute names in the workfile .
@wfattrvals string containing a list of attribute values in the workfile .
@wlookup string list formed from objects in a workfile or database matching a pattern.
@wquery returns a string list of object attributes for all objects in the database that satisfy the query
@wread returns a string containing the contents of the specified text file on disk
@xgetstr returns a scalar string value from the external application
@xgetnum returns a scalar numeric value from the external application
@xputnames r.
@xtype type of external connection
@xverstr returns the external application version number as a string
@xvernum returns the external application version number as a number
There is also a set of functions that may be used to obtain information about the active workfile. See “Basic Workfile Functions”.
Dialog Display Functions
@uidialog display a dialog with multiple controls.
@uiedit display a dialog with an edit control.
@uilist display a dialog with a listbox control.
@uimlist display a dialog with a multiple-select listbox control.
@uiprompt display a prompt dialog.
@uiradio display a dialog with radio buttons.