Page 1 of 1

Subroutine arguments

Posted: Tue Aug 13, 2013 10:56 am
by DBel2012
Hello,

I'm using Eviews 7

I've got two questions :

I'm wrinting a sub which will have two arguments : Subroutine mySub(Series mySeries, Sample mySmpl)

1) while inside the sub, how can I assign the value of mySmpl to a string : %myRange = ????

2) Instead of passing a Series to my sub, Is it possible to pass a transformation of a series, i.e. passing @pch(variable) instead of passing variable?

Thanks!
Danny

Re: Subroutine arguments

Posted: Tue Aug 13, 2013 11:04 am
by EViews Gareth
1) is tricky. Something like:

Code: Select all

subroutine foo(sample mysmpl) %origsmpl = @pagesmpl 'store original sample smpl mysmpl 'set the current sample to be the sample object %myrange = @pagesmpl ' retrieve the string specification of the current sample smpl {%origsmpl} 'restore the original sample. endsub
To be honest, you're better off passing a string into the subroutine rather than a sample object. I personally never write subroutines that accept sample objects. Not worth the hassle.

2) Unfortunately not.

Re: Subroutine arguments

Posted: Tue Aug 13, 2013 11:09 am
by DBel2012
Gareth,

Thanks a lot for the quick response, and also for the advice. Very much appreciated.

Danny