E Views Programming
E Views Programming
Program Basics
What is a Program?
Creating a Program
Program Formatting
Saving a Program
Saving the Command Window
Encrypting a Program
Opening a Program
Executing a Program
The Run Program Dialog
The Run and Exec Commands
External Automation Tools
Stopping a Program
Running Part of a Program
What is a Program?
A program is simply a text file containing EViews
commands. It is not an EViews object in a workfile. It
exists as a file on your computer hard disk, generally
with a .PRG extension.
Creating a Program
To create a new program, click File/New/Program.
You will see a standard text editing window where you
can type in the lines of the program. You may also
open the program window by typing program in the
command window, followed by an optional program
name. For example
program firstprg
opens a program window named FIRSTPRG.
Program names should follow standard EViews rules
for file names.
Program Formatting
As noted earlier, an EViews program is a text file,
consisting of one or more lines of text. Generally, each
line of a program corresponds to a single EViews
command, so you may enter the text for each
command and terminate the line by pressing the
ENTER key.
If a program line is longer than the current program
window, EViews will, by default, autowrap the text of
the line. Autowrapping alters the appearance of the
program line by displaying it on multiple lines, but
does not change the contents of the line. While resizing
the window will change the autowrap position, the text
remains unchanged and is still contained in a single
line. You may turn off autowrapping in programs via
Options/General Options/Programs and deselecting the
Saving a Program
After you have created and edited your program, you
will probably want to save it. Press the Save or SaveAs
button on the program window toolbar. When saved,
the program will have the extension .PRG.
1
open mysp500.prg
open "c:\mywork is here\eviews\myhouse.prg"
open the file Mysp500.PRG in the default EViews
directory, and Myhouse.PRG located in the directory
c:\mywork is here\eviews.
Executing a Program
Executing a program is the process of running all of
the commands in a program file.
Note that EViews commands can be executed in two
distinct ways. When you enter and run, line by line, a
series of commands in the command window, we say
that you are working in interactive mode.
Alternatively, you can type all of the commands in a
program and execute or run them collectively as a
batch of commands. When you run the commands
from a program file, we say that you are in (noninteractive) program mode or batch mode.
There are several ways to execute an EViews program:
The easiest method is by pushing the Run button on
an open program window and entering settings in the
Run Program dialog.
Alternately, you may use the run or exec command to
execute a program.
You may use external automation tools to run
EViews and execute a program from outside of the
EViews application environment.
You may select a set of subset of lines to execute and
run the selected lines.
Encrypting a Program
EViews offers you the option of encrypting a program
file so that you may distribute it to others in a form
where they may not view the original text. Encrypted
files may be opened and the program lines may be
executed, but the source lines may not be viewed. To
encrypt a program file simply click on the Encrypt
button on the program window.
EViews will create an untitled program containing the
contents of the original program, but with only the
visible text Encrypted program. You may save this
encrypted program in the usual fashion using Save or The Run Program Dialog
SaveAs.
Note that once a program is encrypted it may not be
unencrypted; encryption should not be viewed as a
method of password protecting a program. You should
always keep a separate copy of the original source
program. To use an encrypted program, simply open it
and run the program in the usual fashion.
Opening a Program
To load a program file previously saved on disk, click
on File/Open/Program..., navigate to the appropriate
directory, and click on the desired name. You may also
drag an EViews program file onto the EViews window
to open it. Alternatively, from the command line, you
may type the keyword open followed by the full
program name, including the file extension .PRG.
By default, EViews will look for the program in the
default directory, but you may include the full path to
the file and enclosed the entire name in quotations, if
desired. For example, the commands:
Procedure Reference, where they are listed by object in the command window. In the program window that
type.
opens for MYPROG, we are going to enter the
commands to create a workfile, fetch a series from an
Functions may be used to create new data, either in EViews database named PROGDEMO, run a
the form of workfile objects or as program variables.
regression, compute residuals and a forecast, make a
Creating a new series that is equal to the moving plot of the forecast, and save the results.
average of an existing series is done with the @movav
function. The @rbinom function is used to generate a
random scalar or series from the binomial distribution.
@pagefreq may be used to generate a string object or
program variable containing the frequency of the
current workfile page. In general, functions all start
with the @ symbol.
reg1.makeresid hsfres
smpl 1993m1 1997m6
reg1.forecast hsffit
freeze(hsfplot) hsffit.line
save
Control Variables
fetch progdemo::fspcom
!x
!1
!counter
String Variables
Replacement Variables
!counter = !counter + 1
String Variables
"3.14159"
You should also take care to avoid inadvertent Here is a simple example where we use string
replacement of program variables, as outlined in operations to concatenate the contents of three string
variables.
Replacement Variables.
7
!repeat = 500
value. In this context we refer to the expression If you wish to use a string variable %VAR to refer to
{%x} as a replacement variable since the string the INCOME series, you must use the replacement
variable %X is replaced in the command line by the variable in the @obs function, as in
name or names of objects to which the string refers.
%var = "income"
Suppose we want to create the series Y and set it equal
to the values in the series GDP. Given the string @obs({%var})
variable %X defined above, the series declaration,
since you wish to refer indirectly to the object named
in %VAR. Note that the expression
series y = %x
%object = "group"
%space = " "
series y = {%x}
%reg1 = "gender"
is properly interpreted as
%reg2 = "income"
series y = gdp
%reg3 = "age"
Similarly,
variables,
the
program
line
using
replacement
%regs = %reg1 + %space + %reg2 + %space + %reg3
then enclose the string variable in braces. In the
expression,
{%object} g1 {%regs}
equation eq1.ls gdp c gdp(-1)
EViews will substitute the names found in %OBJECT
Changing the contents of %x to M1 changes the and %REGS so that the resulting command is
interpretation of the original program line to
group g1 gender income age
equation eq1.ls m1 c m1(-1)
It is worth noting that replacement variables may be
since the replacement variable uses the name obtained used as building blocks to form object names. For
from the new value of %X.
example, the commands
To take another example, when trying to find the %b = "2"
number of valid (non-missing) observations in a series
named INCOME, you may use the @obs function %c = "temp"
along with the name of the series:
series z{%b}
@obs(income)
9
matrix(2, 2) x{%b}
!x = 10
vector(3) x_{%c}_y
series y = !x1
matrix named X2, where the first line has !X rather than !X1, EViews
will not generate an error due to the missing !X1
variable, but will instead evaluate the second line by
Up to this point, we have focused on replacement substituting !X into the expression, and evaluating the
variables formed from string variables. However, result as 101.
control variables may also be used to form replacement
Replacement variables may be constructed using
variables. For example, the commands
nested evaluation of replacement variables. Suppose
!i = 1
we have the strings:
declare a series named Z2, a
and a vector named X_TEMP_Y.
%str1 = "x"
!j = 0
%name = "%str1"
are equivalent to
series y1 = nrnd
!y = 2
scalar r2 = {%x{!y}}
!a = 2
matrix mat{!a}
mode quiet
so that the meaning of replacement variable names are
more apparent from casual examination of the [some program lines]
program.
mode verbose
Last updated: Tue, 18 Oct 2016 23:23:47 PST
[additional program lines]
Program Modes
Note that setting the execution mode explicitly in a
Program Message Logging
program overrides any settings specified at the time the
program is executed.
Program modes describe different settings associated
with the execution of your program. You may, for Program Message Logging
example, choose to provide verbose messaging where
your program will echo each command to the status When executing a program in EViews, it may be
line, or you may choose quiet mode. Alternately, you useful to keep track of what is happening during
may wish to run a legacy program file in Version 4 execution. Log windows allow you to determine more
accurately the state of various objects in your workfile
compatibility mode.
or follow program progression.
EViews provides you with the opportunity to set
program execution modes at the time that the program Log windows may be switched on using the logmode
is first run. In addition, you may use the MODE command. One log window is created for each
statement to change the execution mode of a program program. If a program is executed more than once and
from within the program itself. One important benefit a log window has already been created, the log
to using MODE statements is that the program can window will be cleared and all subsequent messages
begin executing in one mode, and switch to a second will be sent to the existing log window. If you wish to
preserve a log, you may either save the log to a text file
mode as the program executes.
or freeze it, creating a text file object.
To change the mode for quiet or verbose mode, simply
add a line to your program reading MODE followed There are several types of messages which can be
by either the QUIET or the VERBOSE keyword, logged: program lines, status line messages, user log
messages, and program errors. When displayed in a log
as in
message, each type will appear in a different color,
mode quiet
making it easier to differentiate one type from another.
Program lines are echoes of the line of code in the
For version 4 compatibility, you should use the program currently being executed, and are displayed in
keyword VER4:
black. Status line messages are the messages displayed
in the status line (see The Status Line ) and appear in
mode ver4
blue. User log messages are custom messages created
as a line in the body of the program.
by the program via the logmsg command and appear in
green. Program errors are messages generated when a
Multiple settings may be set in a single MODE line:
logical or syntax error has occurred and appear in red.
mode quiet ver4
12
run regress
executes
ls y c time
In both cases, EViews ignores arguments that are not
included in your run command.
As a last example, we repeat our simple forecasting
program from above, but use arguments to simplify our
work. Suppose you have the program MYPROG:
wfcreate(wf={%0}) m 1968m3 1997m6
fetch progdemo::{%1}
smpl 1968m5 1992m12
equation reg1.ls {%1} c {%1}(-1)
reg1.makeresid {%1}res
smpl 1993m1 1997m6
reg1.forecast {%1}fit
freeze({%1}plot) {%1}fit.line
save
The results of running the two example programs at the
start of this chapter can be duplicated by running
MYPROG with arguments:
run myprog myhouse hsf
and
run myprog mysp500 fspcom
Last updated: Tue, 18 Oct 2016 23:23:47 PST
Program Options
Much like program arguments, program options are
special string variables that may be passed to your
program when you run the program. You may specify
options by providing a comma separated list of options
in parentheses in the run or exec command statement,
immediately after the name of the program as in:
run myprogram(myoption1, myoption2)
Note that options are only supported via the command
line method using run or exec. You cannot pass an
option to a program when running a program via the
menus. Options are included via the command line by
entering them in parenthesis immediately following the
name of the program to be run.
In contrast with arguments, options may not be
accessed directly from within your program. Rather
you can only test for the existence of an option, or
retrieve part of an option. The @hasoption command
lets you test for the existence of an option. For
example, @hasoption("k") will return a value of 1 if
13
the k option was passed into the program at run time, example, if we were to name our above program as
or 0 if it was not.
MY PROG, then the correct method to issue options is:
@equaloption may be used to return the value to the
right of an equality sign in an option. For example if
cov=hac
is
entered
as
an
option,
@equaloption("cov") would return hac. If the option
was not entered at all, @equaloption will return an
empty string.
IF Statements
14
or
else
If the expression is true, all of the commands until the series newage = age
matching endif are executed. If the expression is false,
endif
all of these commands are skipped. For example,
endif
endif
series stateid = 1
else
if %0="MA" then
series stateid=2
else
endif
endif
endif
executes the series statement if !SCALE is a nonYou should note when using the IF statement with
missing, non-zero value.
series or matrix objects that the comparison is defined
An IF statement may include a matching ELSE clause on the entire object and will evaluate to false unless
containing commands to be executed if the condition is every element of the element-wise comparison is true.
FALSE. If the condition is true, all of the commands Thus, if X and Y are series, the IF statement
up to the keyword else will be executed. If the
condition is FALSE, all of the commands between else if x<>y then
and endif will be executed. For example:
[some program lines]
if !scale>0 then
15
endif
for !j=1 to 10
next
The syntax of the FOR statement differs depending One important use of FOR loops with control variables
upon whether it uses numerical variables or string is to change the workfile sample using a smpl
command. If you add a control variable to a date in a
variables.
smpl command statement, you will get a new date as
FOR Loops with Numerical Control Variables or many observations forward as the current value of the
Scalars
control variable. Here is a FOR loop that gradually
increases the size of the sample and estimates a
To repeat statements for different values of a control recursive regression:
variable, you should follow the for keyword by a
control variable initialization, the word to, and then an for !horizon=10 to 72
ending value. After the ending value you may include
the word step followed by a number indicating an smpl 1970m1 1970m1+!horizon
amount to change the control variable each time the equation eq{!horizon}.ls sales c orders
loop is executed. If you dont include step, the step is
next
assumed to be 1. Consider, for example the loop:
16
One other important case uses loops and control for !i=1 to 25
variables to access elements of a matrix object. For
vector a!i
example,
!rows = @rows(vec1)
!i=!i+10
next
To access an individual element of a series, you will You may execute FOR loops with scalars instead of
need to use the @elem function and @otod to get the control variables. However, you must first declare the
scalar, and you may not use the scalar as a replacement
desired element
variable. For example,
for !i=2 to !rows
scalar i
cumsum1(!i) = @elem(ser1, @otod(!i))
scalar sum = 0
next
vector (10) x
The @otod function returns the date associated with
the observation index (counting from the beginning of for i=1 to 10
the workfile), and the @elem function extracts the x(i) = i
series element associated with a given date.
sum = sum + i
You may nest FOR loops to contain loops within
loops. The entire inner FOR loop is executed for each next
successive value of the outer FOR loop. For example:
In this example, the scalar objects I and SUM remain
matrix(25,10) xx
in the workfile after the program has finished running,
unless they are explicitly deleted. When using scalar
for !i=1 to 25
objects as the looping variable you should be careful
that the scalar is always available white the FOR loop
for !j=1 to 10
is active. You should not, for example, delete the
xx(!i,!j)=(!i-1)*10+!j
scalar or change the workfile page within the FOR
loop.
next
FOR Loops with String Variables and String Objects
next
To repeat statements for different values of a string
You should avoid changing the control variable within
variable, you may use the FOR loop to let a string
a FOR loop. Consider, for example, the commands:
variable range over a list of string values. You should
list the FOR keyword, followed by the name of the
' potentially confusing loop (avoid doing this)
17
string program variable, followed by the list of values. the object name or replacement variable with curly
For example,
braces ({ }). For example,
for %y gdp gnp ndp nnp
%label = "year1"
next
next
You may include multiple string variables in the same smpl 1960m1 1960m12
FOR statementEViews will process the string values
in sets. For example, we may define a loop with list equation year1eq.ls sales c orders
three string variables:
Note the difference between using a FOR loop with
for %1 %2 %3 1955q1 1960q4 early 1970q2 1980q3 multiple string variables and using nested FOR loops.
mid 1975q4 1995q1 late
In the multiple string variable case, all string variables
are advanced at the same time, while with nested
smpl %1 %2
loops, the inner variable is advanced over all choices,
for each value of the outer variable. For example:
equation {%3}eq.ls sales c orders
next
!eqno = 1
In this case, the elements of the list are taken in groups for %1 1955q1 1960q4
of three. The loop is executed three times for the for %2 1970q2 1980q3 1975q4
different sample pairs and equation names:
smpl %1 %2
smpl 1955q1 1960q4
'form equation name as eq1 through eq6
equation earlyeq.ls sales c orders
equation eq{!eqno}.ls sales c orders
smpl 1970q2 1980q3
!eqno=!eqno+1
equation mideq.ls sales c orders
next
smpl 1975q4 1995q1
next
equation lateeq.ls sales c orders
Here, the equations are estimated over the samples
Both string objects and replacement variables may be 1955Q11970Q2 for EQ1, 1955Q11980Q3 for EQ2,
used to specify a list for use in loops, by surrounding 1955Q11975Q4 for EQ3, 1960Q41970Q2 for EQ4,
18
1960Q41980Q3 for EQ5, and 1960Q41975Q4 for There are four parts to this WHILE loop. The first part
EQ6.
is the initialization of the control variables used in the
test condition. The second part is the WHILE
Note that you may use the exitloop command to exit a statement which includes the test. The third part is the
FOR loop early. See Exiting Loops.
statements updating the control variables. Finally the
end of the loop is marked by the word wend.
The WHILE Loop
In some cases, we wish to repeat a series of commands
several times, but only while one or more conditions
are satisfied. Like the FOR loop, the WHILE loop
allows you to repeat commands, but the WHILE loop
provides greater flexibility in specifying the required
conditions.
Handling Errors
!val = !val*10
!val = 1
!a = 1
while !val<10000 and !a<10
!a = !a+1
wend
19
[various commands]
!df = 9
endif
!old_count = @errorcount
equation eq1.ls y x c
!new_count = @errorcount
next
scalar lag=!lag
Note that the scalar LAG has the value 0 if none of the
test statistics are rejected.
If the exitloop is issued inside nested loops it will stop
execution of the innermost loop. Execution of the
remaining loops is unaffected.
20
21
It forms the square of the existing series Z and stores it where depends upon the argument . The argument
in the new series X.
is merely a place holderits there to define the
You may use the return command to force EViews to function and it does not really stand for anything.
exit from the subroutine at any time. A common use of Then, if you want to evaluate the function at a
return is to exit from the subroutine if an unanticipated particular numerical value, say 0.7839, you can write
error is detected. The following program exits the
. If you want to evaluate the function at a
subroutine if Durbins statistic (Greene, 2008, p. different value, say 0.50123, you merely write
646, or Davidson and MacKinnon, 1993, p. 360) for
. By defining the function, you save
testing serial correlation with a lagged dependent yourself from writing the full function expression
variable cannot be computed:
every time you wish to evaluate it for a different value.
subroutine durbin_h
if test<=0 then
v = y^p
return
endsub
endif
22
include powers
uses object names. In the first case you should refer to load mywork
!A and %B inside the subroutine; in the latter case,
fetch z gdp
you should refer to the objects named A and B.
If you define your subroutine using program variables, series x
the subroutine will operate on them as though they series gdp2
were any other program variable. The variables, which
cannot go out-of-scope, should be referred to using the series gdp3
! or % argument name inside the subroutine.
call z_square
If you define your subroutine using object names, the
subroutine will operate on those variables as though call power(gdp2,gdp,2)
they were scalar or string objects. The variables, which call power(gdp3,gdp,3)
may be deleted and may go out-of-scope (if, for
example, you change the workfile page), should be The call of the Z_SQUARE subroutine fills the series
referred to using the argument names as though they X with the value of Z squared. Next, the call to the
POWER subroutine creates the series GDP2 which is
were scalar or string objects.
GDP squared. The last call to POWER creates the
(We discuss in detail related issues in Calling series GDP3 as the cube of GDP.
Subroutines.)
When calling your subroutine, bear in mind that:
You should note that EViews makes no distinction
between input or output arguments in a subroutine. When the subroutine argument is a scalar, the
Each argument may be an input to the subroutine, an subroutine may be called with a scalar object, a control
output from the subroutine, or both (or neither!). There variable, a simple number (such as 10 or 15.3), a
is no way to declare that some arguments are inputs matrix element (such as mat1(1,2)) or a scalar
and some are outputs. There is no need to order the expression (such as !y+25).
arguments in any particular order. However we find it
Subroutines with a string argument may be called
much easier to read subroutine code when we stick to a
with a string object, a string program variable, simple
convention, such as listing all output arguments prior
text (such as hello) or an element of an svector
to all input arguments (or vice versa).
object.
23
Subroutines that take matrix and vector arguments However the subroutine is called, bear in mind that
can be called with a matrix name, and if not modified behavior inside the subroutine is dependent on whether
by the subroutine, may also take a matrix expression.
the subroutine declaration is in terms of program
variables or objects, not on the variable type that is
All other arguments must be passed to the subroutine passed into the subroutine.
with an object name referring to a single object of the
correct type.
Subroutine Placement
In Subroutine with Arguments we described how
you can define subroutines that use either program
variables or objects for scalar or string arguments.
However you define your subroutine, you may call the
subroutine using either program variables or objects
you are not required to match the calling arguments
with the subroutine definition. Suppose, for example,
that you define your subroutine as
subroutine mysub(scalar a, string b)
string g = "hello"
load mywork
!x = 2
fetch z
%y = "goodbye"
call z_square
you may call the subroutine using any of the following Execution of this program begins with the load
statement; the subroutine definition is skipped and is
commands:
executed only at the last line when it is called.
call mysub(!x, %y)
Subroutine definitions must not overlapafter the
call mysub(!x, g)
subroutine keyword, there should be an endsub before
the next subroutine declaration. Subroutines may call
call mysub(f, %y)
each other, or even call themselves.
call mysub(f, g)
include powers
at the top of any other program that needs to call Here is a simple program that calls a global subroutine:
Z_SQUARE or POWER. You can use the subroutines
in these programs as though they were built-in parts of subroutine z_square
the EViews programming language.
series x = z^2
Global and Local Variables
endsub
Subroutines work with variables and objects that are load mywork
either global or local.
fetch z
Global variables refer either to objects which exist in
the workfile when the subroutine is called, and to call z_square
objects that are created in the workfile by a subroutine.
Z_SQUARE is a global subroutine which has access to
Global variables remain in the workfile when the
the global series Z. The new global series X contains
subroutine finishes.
the square of the series Z. Both X and Z remain in the
A local variable is one that is defined within the workfile when Z_SQUARE is finished.
subroutine. Local variables are deleted from the
If one of the arguments of the subroutine has the same
workfile once a subroutine finishes. The program that
name as a global variable, the argument name takes
calls the subroutine will not be able to use a local
precedence so that any reference to the name in the
variable since the local variable disappears once the
subroutine will refer to the argument, not to the global
subroutine finishes and the original program continues.
variable. For example:
Global Subroutines
subroutine sqseries(series z, string sername)
By default, subroutines in EViews are global. Global
series {sername} = z^2
subroutine may refer to any global object that exists in
the workfile at the time the subroutine is called. Thus, endsub
if Z is a series in the workfile, the subroutine may refer
to and, if desired, alter the series Z. Similarly, if Y is a load mywork
global matrix that has been created by another
fetch z
subroutine, the current subroutine may use the matrix
Y.
fetch y
The rules for variables in global subroutines are:
All objects created by a global subroutine are global In this example, there is a series Z in the original
and will remain in the workfile when the subroutine workfile and Z is also an argument of the subroutine.
finishes.
Calling SQSERIES with the argument set to Y tells
EViews to use the series passed-in via the argument Z
Global objects may be used and updated directly
instead of the global Z series. On completion of the
from within the subroutine. If, however, a global object
routine, the new series Y2 will contain the square of
has the same name as an argument in a subroutine, the
the series Y, not the square of the series Z. Since
variable name will refer to the argument and not to the
keeping track of variables can become confusing when
global variable.
subroutine arguments take the same name as existing
The global objects corresponding to arguments may workfile objects, we encourage you to name subroutine
arguments as clearly and distinctly as possible.
be used and updated by referring to the arguments.
25
load mywork
equation eq1
series x
call ols(eq1, y)
call newxy
equation eq2
Local Subroutines
delete temp
endsub
endsub
subroutine ols(equation eq, series y)
fetch cpi
fetch cs
call wgtols(cs,cpi)
26
passed into the subroutine using a series argument. Note that we first declare the series URES and scalar
Conversely, if X is passed into the subroutine, it may USSR before calling the local subroutine. These
be modified.
objects are global since they are declared outside the
local subroutine. Since we call the local subroutine by
Since locally created objects will vanish upon passing these global objects as arguments, the
completion of the subroutine, to save results from a subroutine can use and update these global variables.
local subroutine, you have to include them as
arguments. For example, consider the subroutine:
Object commands that require access to global
variables should be used with care in local subroutines
subroutine local ols_local(series y, series res, scalar since that the lack of access to global variables can
ssr)
create problems for views or procs of objects passed
into the routine. For example, a subroutine of the form:
equation temp_eq.ls y c y(-1) y(-1)^2 y(-1)^3
temp_eq.makeresid res
ssr = temp_eq.@ssr
eq.hettest z c
scalar se = ssr/temp_eq.@df
endsub
load mywork
fetch hsf
equation eq1.ls hsf c hsf(-1)
eq1.makeresid rres
scalar rssr = eq1.@ssr
series ures
scalar ussr
call ols_local(hsf, ures, ussr)
@uiradio creates a set of radio controls, which lets the user and let them continue or cancel from the
users select from a set of choices.
procedure.
@uidialog creates a dialog which contains a if type is equal to YN, then the dialog will contain
mixture of other controls.
a Yes button and a No button which can be used to
ask the user a question requiring an affirmative or
@uifiledlg creates a open/save-style dialog to negative response.
obtain the name of a file.
if type is equal to YNC the dialog will have a
Each dialog function returns an integer indicating how Yes button, a No button and a Cancel button.
the user exited the dialog:
For example, the command:
User Selection Return Value
Cancel
-1
@uiprompt("Welcome to EViews")
OK
0
Yes
1
No
2
Note that the only dialog types that can return exit
conditions other than Cancel or OK are
@uiprompt and @uidialog. If Cancel is pressed, the
variables passed into the dialog will not be updated will display a simple dialog box with a simple
with whatever settings the user has chosen. If OK is welcome message and an OK button, while the
command
pressed, then the dialog changes are accepted.
Each of the dialog functions accept arguments that are
used to define what will be displayed by the dialog,
and that will be used to store the user's inputs to the
dialog. You may use string or a scalar arguments,
where both the string and scalar can be a literal, a
program variable, or a workfile object.
@uiprompt
The @uiprompt(string prompt, string type) function
creates a simple message/prompt box that displays a
single piece of text, specified using the prompt
argument, and lets the user click a button to indicate an
action. The choices of action offered the user will
depend upon the string specified in type.
IOString. If IOString contains text before the @uiedit and one that stores it as an integer IOScalar
function is called, the edit box will be initialized with representing the position of the selection in the list,
that text.
@uilist(scalar IOScalar, string prompt, string list)
The string prompt is used to specify text to be
displayed above the edit box, which may be used to The string prompt is used to specify text to be
displayed above the list box, providing a message or
provide a message or instructions to the user.
instructions to the user.
maxEditLen is an option integer scalar that specifies
the maximum length that IOString can take. If the user The string list is a space delimited list of items that will
tries to enter text longer than maxEditLen characters, be displayed in the list box. To specify entries with
the extra characters will be truncated. By default spaces, you should enclose the entry in double-quotes
using double-quote escape characters.
maxEditLen is set to 32.
Both prompt and maxEditLen may be written in-line Both prompt and list may be provided using in-line
using string literals, but IOString must be either a text, but IOString or IOScalar must be either a program
variable or an object in your workfile.
program variable or a string object in your workfile.
If the IO variable (IOString or IOScalar) is defined
before the function is called, then the list box control
%eqname = "eq_unemp"
will have the item defined by the variable pre-selected.
If the IO variable does not match an item in the list
scalar ret = @uiedit(%eqname, "Enter a name for your box, or if it is not pre-defined, the first item in the list
equation")
will be selected.
As an example,
The string prompt is used to specify text to be The string prompt should be used to specify a message
or instructions to the user to be displayed above the set
displayed above the list box, providing a message or
of radio buttons.
instructions to the user.
The string list is a space delimited list of items that will
be displayed in the list box. To specify entries with
spaces, you should enclose the entry in double-quotes
using double-quote escape characters.
scalar ret = @uiradio(!choice, "Standard Errors specification for an edit box would be (edit, string
Choice", %list)
IOString, string prompt, scalar maxEditLen).
%choice = @word(%list,!choice)
statusline %choice
text) where text specifies the text that will be on the IO_Filespec will also contain the file specified on
button.
return.
The column break control inserts a column break. By
default, EViews will automatically choose the number
of columns in the constructed dialog. There is still a
maximum of only two columns allowed, but by adding
a colbreak control, you can force the position of a
break in the dialog.
@uiedit(%dep,"Enter
the