String arguments to @cumsum

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Dave_the_Forecaster
Posts: 16
Joined: Fri Aug 16, 2013 1:52 am

String arguments to @cumsum

Postby Dave_the_Forecaster » Fri Sep 06, 2013 5:45 am

Hi,

I have a programming niggle that I'm hoping someone on here can help with.

I have several dates saved as strings:

Code: Select all

%snap1="2013Q4" %snap2="2014Q4" 'etc etc
I need to use the function @cumsum within a loop, using various combinations of the above dates as the sample restriction for @cumsum.

The problem I'm having is that @cumsum requires the sample to be entered as a single string inside double quotes. I know that I can get around the problem by first defining a separate string for each sample range I need:

Code: Select all

%smpl1=%snap1 + " " + %snap2 'etc
but, due to the number of different samples I need, this is not a very elegant solution to my problem.

Any ideas??

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: String arguments to @cumsum

Postby EViews Gareth » Fri Sep 06, 2013 6:55 am

The way you're doing it is probably best.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests