Page 1 of 1

Can I set up default argument in subroutine?

Posted: Tue Aug 06, 2013 8:14 am
by Liu
Hi,

I am wondering if eViews 8 allows default option for subroutine argument, so that when user chooses not to specify one
parameter, it will use a default vale.

for example, I am creating a bollinger band subroutine.
subroutine bollinger( series x1, scalar N, scalar K)

Can I use command below or other means to set up default value of the argument, in the way that if users don't specify then the subroutine takes 20 and 2 as default?
subroutine bollinger (series x1, scalar N=20, scalar K=2)


when users use it, ideally they can just write
call bollinger(x1)
if they don't want to use other values.

I tried to write subroutine in the above way, but eViews tell me that more arguments are needed. Is there a way to set up default value so as to reduce
number of arguments in some cases?

Thank you.

Re: Can I set up default argument in subroutine?

Posted: Tue Aug 06, 2013 8:25 am
by EViews Gareth
Unfortunately not.


As an aside, you might want to take a look at the Bollinger bands subroutine inside the TechAsis add-in.