简单eviews命令(2)
发布时间:2021-06-05
发布时间:2021-06-05
全英文
3Writingtheprogram
openanexistingwork le:openc:\mypath\mywork
or
creatinganewwork lenamedmywork:workfilemyworku110000 Allvariablesusedhavetobedeclared rst Don’tforgettosaveitfromtimetotime!
Usecommentsextensivelytounderstandyourprogramlateron,commentlinesbeginwitha’,forexample:
’thisprogramcomputesVaRonsimulateddata
4Programvariables
(seealsounderhelp→EViewssearch)
Control(program)variables:namesbeginwitha!!anfang=1
!ende=!anfang+100 Generalvariablescoefaseriesxvector(10)vmatrix(10,3)mgroupg
Stringvariables(textenclosedindoublequotes):namesbeginwitha%
%str="Thisisastring"
youcanusestringstohelpyoubuildupcommandsandvariablenamesorasheadingsintables
Manipulatingstringvariables
–convertingastringvariablecontaininganumberintoanumberbyusingthe@valfunction%str=".05"
!nmbr=@val(%strng)
–convertinganumberintoastringvariable%strng=@str(!nmbr)–concatenatingstrings
%sampleperiod=""+@str(!anfang)+""+@str(!ende) Replacementvariables:EViewsallowsyoutoconstructcommandlinesusingthecontentsofstringandcontrolvariables.!i=1
seriesx!i%strng="new"seriesx%strng}
declaresaseriesnamedx1declaresaseriesnamedx
下一篇:项目管理体系和组织架构