Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Command Ref.pdf
Скачиваний:
79
Добавлен:
23.03.2015
Размер:
5.23 Mб
Скачать

116—Chapter 6. EViews Programming

Local subroutines can call global subroutines and vice versa. The global subroutine will only have access to the global variables, and the local subroutine will only have access to the local variables, unless information is passed between the routines via arguments. For example, the subroutine

subroutine newols(series y, series res) include ols

equation eq1.ls y c y(-1) eq1.makeresid res

scalar rssr=eq1.@ssr series ures

scalar ussr

call ols(y, ures, ussr) endsub

and the program load mywork fetch hsf series rres

call newols(hsf, rres)

produce equivalent results. Note that the subroutine NEWOLS still does not have access to any of the temporary variables in the local routine OLS, even though OLS is called from within NEWOLS.

Programming Summary

Support Commands

open ....................

opens a program file from disk (p. 373).

output..................

redirects print output to objects or files (p. 380).

poff......................

turns off automatic printing in programs (p. 638).

pon......................

turns on automatic printing in programs (p. 638).

program ...............

declares a program.

run ......................

runs a program (p. 428).

statusline .............

sends message to the status line (p. 639).

tic........................

reset the timer (p. 510).

toc .......................

display elapsed time (since timer reset) in seconds (p. 511).

Program Statements

call ......................

calls a subroutine within a program (p. 633).

 

Programming Summary—117

 

 

else.......................

denotes start of alternative clause for IF (p. 634).

endif.....................

marks end of conditional commands (p. 634).

endsub .................

marks end of subroutine definition (p. 634).

exitloop ................

exits from current loop (p. 635).

for ........................

start of FOR execution loop (p. 636).

if ..........................

conditional execution statement (p. 636).

include .................

include subroutine in programs (p. 637).

next......................

end of FOR loop (p. 637).

return ...................

exit subroutine (p. 639).

step ......................

(optional) step size of a FOR loop (p. 640).

stop ......................

halts execution of program (p. 641).

subroutine ............

declares subroutine (p. 641).

then......................

part of IF statement (p. 642).

to .........................

upper limit of FOR loop (p. 643).

wend ....................

end of WHILE loop (p. 644).

while ....................

start of WHILE loop (p. 644).

Support Functions

 

@date...................

string containing the current date (p. 633).

@errorcount .........

number of errors encountered (p. 635).

@evpath...............

string containing the directory path for the EViews executable

 

(p. 635).

@isobject .............

checks for existence of object (p. 637).

@temppath...........

string containing the directory path for EViews temporary files

 

(p. 641).

@time ..................

string containing the current time (p. 642).

@toc ....................

calculates elapsed time (since timer reset) in seconds (p. 643).

118—Chapter 6. EViews Programming

Соседние файлы в папке Docs