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

next—637

Cross-references

See “IF Statements” on page 100. See also else (p. 634), endif (p. 634), then (p. 642).

include

Program Statement

 

 

Include another file in a program.

The include statement is used to include the contents of another file in a program file.

Syntax

include filename

Cross-references

See “Multiple Program Files” on page 108. See also call (p. 633).

@isobject

Support Function

 

 

Syntax:

@isobject(str)

Argument:

string, str

Return:

integer

Check for an object’s existence. Returns a “1” if the object exists in the current workfile, and a “0” if it does not exist.

next

Program Statement

 

 

End of FOR loop. next marks the end of a FOR loop in a program.

Syntax

for [conditions of the FOR loop]

[commands]

next

Cross-references

See “The FOR Loop” beginning on page 102. See also, exitloop (p. 635), for (p. 636), step (p. 640).

638—Appendix H. Programming Language Reference

open

Command

 

 

Open a file. Opens a workfile, database, program file, or ASCII text file.

See open (p. 373).

output

Command

 

 

Redirects printer output or display estimation output.

See output (p. 380).

poff

Program Statement

 

 

Turn off automatic printing in programs.

poff turns off automatic printing of all output. In programs, poff is used in conjunction with pon to control automatic printing; these commands have no effect in interactive use.

Syntax

Command: poff

Cross-references

See “Print Setup” on page 941 for a discussion of printer control.

See also pon (p. 638).

pon

Program Statement

 

 

Turn on automatic printing in programs.

pon instructs EViews to send all statistical and data display output to the printer (or the redirected printer destination; see output (p. 380)). It is equivalent to including the “p” option in all commands that generate output. pon and poff only work in programs; they have no effect in interactive use.

Syntax

Command: pon

statusline—639

Cross-references

See “Print Setup” on page 941 of the User’s Guide for a discussion of printer control.

See also poff (p. 638).

program Command

Create a program.

See program (p. 410).

return

Program Statement

 

 

Exit subroutine.

The return statement forces an exit from a subroutine within a program. A common use of return is to exit from the subroutine if an unanticipated error has occurred.

Syntax

if [condition] then

return

endif

Cross-references

See “Subroutines” beginning on page 109. See also exitloop (p. 635), stop (p. 641).

run

Command

 

 

Run a program. The run command executes a program. The program may be located in memory or stored in a program file on disk.

See run (p. 428).

statusline Command

Send a text message to the EViews status line.

Syntax

statusline string

640—Appendix H. Programming Language Reference

Example

for !i = 1 to 10

statusline Iteration !i

next

step

Program Statement

 

 

Step size of a FOR loop.

Syntax

for !i=a to b step n

[commands]

next

step may be used in a FOR loop to specify the size of the step in the looping variable. If no step is provided, for assumes a step of “+1”.

If a given step exceeds the end value b in the FOR loop specification, the contents of the loop will not be executed.

Examples

for !j=5 to 1 step -1

series x = nrnd*!j

next

repeatedly executes the commands in the loop with the control variable !J set to “5”, “4”, “3”, “2”, “1”.

for !j=0 to 10 step 3

series z = z/!j

next

Loops the commands with the control variable !J set to “0”, “3”, “6”, and “9”.

You should take care when using non-integer values for the stepsize since round-off error may yield unanticipated results. For example:

for !j=0 to 1 step .01

series w = !j

next

may stop before executing the loop for the value !J=1 due to round-off error.

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